Skip to content

-Xsource:2.11 should disallow trailing commas under Scala 2.12? #10818

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

Closed
Sciss opened this issue Apr 9, 2018 · 5 comments
Closed

-Xsource:2.11 should disallow trailing commas under Scala 2.12? #10818

Sciss opened this issue Apr 9, 2018 · 5 comments

Comments

@Sciss
Copy link

Sciss commented Apr 9, 2018

This

List(
  1,
  2,
  3,
)

is valid in Scala 2.12. If I cross-build with 2.11 as another target, I think I should be able to disallow this using

scalacOptions += "-Xsource:2.11"

but the above still compiles under Scala 2.12

@SethTisue SethTisue added this to the Backlog milestone Apr 9, 2018
@OlegYch
Copy link

OlegYch commented Apr 9, 2018

fwiw i use this https://github.com/47deg/scala-commas to cross build to 2.11

@SethTisue
Copy link
Member

I haven't seen that -source respects syntax evolution backwardly

I'm not sure if there's precedent, either. before using -Xsource:2.11 in a build of my own, I think I'd have to do a careful audit for what else changes as a result

@SethTisue
Copy link
Member

SethTisue commented Apr 9, 2018

in general, my impression is that -Xsource (and its sisters -Xfuture and -Xexperimental) are intended for testing, experimentation, and temporary use during migration, and not so much as a component of cross-building support. but then actually I don't know why would we would support backwards -Xsource, as opposed to forward -Xsource, at all

@som-snytt
Copy link

@SethTisue I think this is settled. #8361 except for the backwards part.

Frankly, I can't imagine disallowing trailing comma under any regime. That would only spur tickets to "backport trailing comma."

It's "trailing comma" singular because you only get one.

@dwijnand
Copy link
Member

I think this should be closed. We're not going to add 2.11 source support to 2.13.

@SethTisue SethTisue removed this from the Backlog milestone Sep 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants