-
Notifications
You must be signed in to change notification settings - Fork 337
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
Remove -release option from the Scala 3 PC #3812
Conversation
PReviously, in a number of scenarios this option would break the presentation compiler for Scala 3. Now we filter it out since it's not important for the frontend phases.
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.
LGTM
-release Compile code with classes specific to the given version
of the Java platform available on the classpath and emit
bytecode for this version.
Indeed it's not important for frontend
phases 👍
private def removeDoubleOptions(options: List[String]): List[String] = | ||
options match | ||
case head :: _ :: tail if forbiddenDoubleOptions(head) => | ||
removeDoubleOptions(tail) | ||
case head :: tail => head :: removeDoubleOptions(tail) | ||
case Nil => options |
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.
Why not
private def removeDoubleOptions(options: List[String]): List[String] = | |
options match | |
case head :: _ :: tail if forbiddenDoubleOptions(head) => | |
removeDoubleOptions(tail) | |
case head :: tail => head :: removeDoubleOptions(tail) | |
case Nil => options | |
options.filterNot(forbiddenDoubleOptions) |
?
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.
Ahh, nevermind, removeDoubleOptions
transforms List("-release", "8", ...)
to List(...)
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 had to get a bit more creative here 😅
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.
Great!
Previously, in a number of scenarios this option would break the presentation compiler for Scala 3. Now we filter it out since it's not important for the frontend phases.