-
Notifications
You must be signed in to change notification settings - Fork 187
build and test against scala 3.7.1 (WIP RC1) #2227
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
base: main
Are you sure you want to change the base?
Conversation
a8674bd
to
aa48bde
Compare
val d = | ||
if (true) Day.Weekday | ||
else Day.Weekend | ||
day(d) | ||
val b = | ||
if (true) True | ||
else False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test infrastructure is not great to represent the intent of that change, but this was copied in order to skip scala3-next.
That's because the 3.7.1-RC1 PC is trying to be smarter when shortening types but gets fooled by the import Bool.
somehow , and we end up with that code that does not compile
val d = | |
if (true) Day.Weekday | |
else Day.Weekend | |
day(d) | |
val b = | |
if (true) True | |
else False | |
val d: Value = | |
if (true) Day.Weekday | |
else Day.Weekend | |
day(d) | |
val b: Value = | |
if (true) True | |
else False |
[error] -- [E007] Type Mismatch Error: /Users/brice.jaglin/git/scala/scalafix/scalafix-tests/output/src/main/scala-3next/test/explicitResultTypes/EnumerationValue.scala:15:18
[error] 15 | if (true) Day.Weekday
[error] | ^^^^^^^^^^^
[error] | Found: (test.explicitResultTypes.EnumerationValue.Day.Weekday :
[error] | test.explicitResultTypes.EnumerationValue.Day.Value)
[error] | Required: test.explicitResultTypes.EnumerationValue.Bool.Value
[error] |
[error] | longer explanation available when compiling with `-explain`
[error] -- [E007] Type Mismatch Error: /Users/brice.jaglin/git/scala/scalafix/scalafix-tests/output/src/main/scala-3next/test/explicitResultTypes/EnumerationValue.scala:16:13
[error] 16 | else Day.Weekend
[error] | ^^^^^^^^^^^
[error] | Found: (test.explicitResultTypes.EnumerationValue.Day.Weekend :
[error] | test.explicitResultTypes.EnumerationValue.Day.Value)
[error] | Required: test.explicitResultTypes.EnumerationValue.Bool.Value
[error] |
[error] | longer explanation available when compiling with `-explain`
[error] -- [E007] Type Mismatch Error: /Users/brice.jaglin/git/scala/scalafix/scalafix-tests/output/src/main/scala-3next/test/explicitResultTypes/EnumerationValue.scala:17:6
[error] 17 | day(d)
[error] | ^
[error] | Found: (test.explicitResultTypes.EnumerationValue.d :
[error] | test.explicitResultTypes.EnumerationValue.Bool.Value)
[error] | Required: test.explicitResultTypes.EnumerationValue.Day.Value
[error] |
[error] | longer explanation available when compiling with `-explain`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just went through the recent changes of the PC and scala/scala3#22898 might be a candidate for the regression.
@tgodzik since you are the author, maybe you can confirm/infirm? I will end up filing an issue upstream eventually, but my knowledge of the dotty repo is limited so it will take me a while to write a unit test :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be some side effect of that PR yeah. It was a tricky part of the compiler. If you could just put the example in a issue I will take a look.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ach, I think I know what is going on. Those are path dependent types and it's not handled at all properly :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've got something working, but I broke another test:
https://github.com/scala/scala3/compare/main...tgodzik:scala3:fix-path-dep?expand=1
I am not sure how to differentiate types that are actually in Scope from those that are not if they actually have the same symbol.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, let's try get scala/scala3#23124 merged, took me longer than expected
3423c8f
to
221ddc0
Compare
No description provided.