-
Notifications
You must be signed in to change notification settings - Fork 1.1k
int/long literal type conforms to float/double literal type with different value via type alias #18340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
Comments
Adjacently, I expected harmonization to kick in:
|
Fill in the rest: @main def main: Unit =
type Ti = 3
val value1i: Ti = -100500 // error
val value2i: Ti = -100500L // error
val value4i: Ti = -100500F // error
val value5i: Ti = -100500D // error
val value6i: Ti = true // error
type Tl = 3L
val value1l: Tl = -100500 // should-be-error
val value2l: Tl = -100500L // error
val value4l: Tl = -100500F // error
val value5l: Tl = -100500D // error
val value6l: Tl = true // error
type Tf = 3f
val value1f: Tf = -100500 // should-be-error
val value2f: Tf = -100500L // should-be-error
val value4f: Tf = -100500F // error
val value5f: Tf = -100500D // error
val value6f: Tf = true // error
type Td = 3d
val value1d: Td = -100500 // should-be-error
val value2d: Td = -100500L // should-be-error
val value4d: Td = -100500F // should-be-error
val value5d: Td = -100500D // error
val value6d: Td = true // error As well as proving it works correctly without a type alias @main def main: Unit =
val lit1i: 3 = -100500 // error
val lit2i: 3 = -100500L // error
val lit4i: 3 = -100500F // error
val lit5i: 3 = -100500D // error
val lit6i: 3 = true // error
val lit1l: 3L = -100500 // error
val lit2l: 3L = -100500L // error
val lit4l: 3L = -100500F // error
val lit5l: 3L = -100500D // error
val lit6l: 3L = true // error
val lit1f: 3f = -100500 // error
val lit2f: 3f = -100500L // error
val lit4f: 3f = -100500F // error
val lit5f: 3f = -100500D // error
val lit6f: 3f = true // error
val lit1d: 3d = -100500 // error
val lit2d: 3d = -100500L // error
val lit4d: 3d = -100500F // error
val lit5d: 3d = -100500D // error
val lit6d: 3d = true // error |
odersky
added a commit
to dotty-staging/dotty
that referenced
this issue
Aug 8, 2023
dwijnand
added a commit
that referenced
this issue
Aug 9, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Compiler version
Scala 3.3.1-RC4
Minimized code
Expectation
The code shouldn't compile
The same issue for
type T = 3d
The text was updated successfully, but these errors were encountered: