-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Test rewrites #9037
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
Test rewrites #9037
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
222d323
Add #8982 to rewrite test
liufengyun 6143745
Add checkRewrites
liufengyun e326612
Move rewrite tests to special directory
liufengyun b1df7fc
Use original check file for easier update
liufengyun c19f6ea
Disable test: it does not recompile with the same flags
liufengyun 70a2ce4
Remove dead code
liufengyun 1298965
Add missing check file
liufengyun b758f7d
Fix rewrite test: -source 3.0-migrate does not imply noindent
liufengyun 66c390f
-indent should take precedence over -source 3.0-migrate
liufengyun 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
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,10 @@ | ||
|
||
object Foo: | ||
def bar(x: Int): Unit = | ||
println(x) | ||
|
||
class Baz(n: Int): | ||
def printRepeat(repeat: Int) = | ||
for { | ||
x <- 1 to repeat | ||
} println(s"$x - ${n * x}") |
File renamed without changes.
File renamed without changes.
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.
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 think having
-source 3.0-migrate
imply-noindent
is intentional: it should allow existing weirdly formatted scala 2 code to compile /cc @odersky.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 issue is that if a user run compiler with
-rewrite
, then it's impossible to compile the code again.It's discovered when we actually compile the rewritten code in the following test:
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.
In that example I think
-indent
needs to take precedence overmigrateTo3
and force indentation to be on.