-
Notifications
You must be signed in to change notification settings - Fork 188
build and test against scala 3.7.1 #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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
24 changes: 24 additions & 0 deletions
24
scalafix-tests/input/src/main/scala-3lts/test/explicitResultTypes/EnumerationValue.scala
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
rules = ExplicitResultTypes | ||
*/ | ||
package test.explicitResultTypes | ||
|
||
object EnumerationValue { | ||
object Day extends Enumeration { | ||
type Day = Value | ||
val Weekday, Weekend = Value | ||
} | ||
object Bool extends Enumeration { | ||
type Bool = Value | ||
val True, False = Value | ||
} | ||
import Bool._ | ||
def day(d: Day.Value): Unit = ??? | ||
val d = | ||
if (true) Day.Weekday | ||
else Day.Weekend | ||
day(d) | ||
val b = | ||
if (true) True | ||
else False | ||
} |
9 changes: 9 additions & 0 deletions
9
...fix-tests/input/src/main/scala-3lts/test/explicitResultTypes/ExplicitResultTypesNil.scala
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* | ||
rules = "ExplicitResultTypes" | ||
ExplicitResultTypes.skipSimpleDefinitions = ["Lit"] | ||
*/ | ||
package test.explicitResultTypes | ||
|
||
object ExplicitResultTypesNil { | ||
val nil = Nil | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
...ix-tests/input/src/main/scala-3next/test/explicitResultTypes/ExplicitResultTypesNil.scala
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* | ||
rules = "ExplicitResultTypes" | ||
ExplicitResultTypes.skipSimpleDefinitions = ["Lit"] | ||
*/ | ||
package test.explicitResultTypes | ||
|
||
object ExplicitResultTypesNil { | ||
val nil = Nil | ||
} |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
6 changes: 6 additions & 0 deletions
6
...ix-tests/output/src/main/scala-3lts/test/explicitResultTypes/ExplicitResultTypesNil.scala
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
package test.explicitResultTypes | ||
|
||
object ExplicitResultTypesNil { | ||
val nil: Nil.type = Nil | ||
} |
6 changes: 6 additions & 0 deletions
6
...x-tests/output/src/main/scala-3next/test/explicitResultTypes/ExplicitResultTypesNil.scala
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
package test.explicitResultTypes | ||
|
||
object ExplicitResultTypesNil { | ||
val nil: scala.collection.immutable.Nil.type = Nil | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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 compileThere 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
Uh oh!
There was an error while loading. Please reload this page.
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.
Thanks! Taking note to simplify the test once 3.7.2-RC1 is tagged
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.
https://github.com/scalacenter/scalafix/pull/2273/files#r2283026452