Skip to content

Commit

Permalink
Support symbol literals under -Xsource:3
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
smarter committed Apr 30, 2021
1 parent 7e0e50e commit f5e2a98
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 11 deletions.
3 changes: 1 addition & 2 deletions src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1421,8 +1421,7 @@ self =>
else if (in.token == SYMBOLLIT) {
def msg(what: String) =
s"""symbol literal is $what; use Symbol("${in.strVal}") instead"""
if (settings.isScala3) syntaxError(in.offset, msg("unsupported"))
else deprecationWarning(in.offset, msg("deprecated"), "2.13.0")
deprecationWarning(in.offset, msg("deprecated"), "2.13.0")
Apply(scalaDot(nme.Symbol), List(finish(in.strVal)))
}
else finish(in.token match {
Expand Down
4 changes: 0 additions & 4 deletions test/files/neg/symbol-literal-removal.check

This file was deleted.

5 changes: 0 additions & 5 deletions test/files/neg/symbol-literal-removal.scala

This file was deleted.

0 comments on commit f5e2a98

Please sign in to comment.