-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add language.deprecated.symbolLiterals import #11588
Conversation
Allow symbol literals if a language import import language.deprecated.symbolLiterals is given. This is useful for legacy software that uses symbol literals. A typical case are Spark notebooks, where column names are expressed with symbol literals.
This PR addresses lampepfl/dotty-feature-requests#182. |
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
report.errorOrMigrationWarning( | ||
em"""symbol literal '${in.name} is no longer supported, | ||
|use a string literal "${in.name}" or an application Symbol("${in.name}") instead, | ||
|or enclose in braces '{${in.name}} if you want a quoted expression.""", |
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.
Should this error mention that the use can import language.deprecated.symbolLiterals
?
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.
yes, I think that would be a good idea
Scala 3 still supports symbol literals even if they require a language import now (cf scala/scala3#11588), so don't emit an error if we find one under -Xsource:3 as that could unnecessarily impede cross-compilation as discovered in scala/scala-dev#769.
Allow symbol literals if a language import
is given. This is useful for legacy software that uses
symbol literals. A typical case are Spark notebooks, where
column names are expressed with symbol literals.