Skip to content
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

Merged
merged 3 commits into from Mar 5, 2021

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Mar 3, 2021

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.

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.
@odersky
Copy link
Contributor Author

odersky commented Mar 3, 2021

This PR addresses lampepfl/dotty-feature-requests#182.

Copy link
Member

@bishabosha bishabosha left a 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.""",
Copy link
Member

@bishabosha bishabosha Mar 5, 2021

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?

Copy link
Contributor Author

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

@odersky odersky merged commit 96ced02 into scala:master Mar 5, 2021
@odersky odersky deleted the add-symlit-import branch March 5, 2021 17:18
smarter added a commit to smarter/scala that referenced this pull request Apr 30, 2021
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.
@Kordyjan Kordyjan added this to the 3.0.0 milestone Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants