Skip to content

Commit f5e2a98

Browse files
committed
Support symbol literals under -Xsource:3
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.
1 parent 7e0e50e commit f5e2a98

File tree

3 files changed

+1
-11
lines changed

3 files changed

+1
-11
lines changed

src/compiler/scala/tools/nsc/ast/parser/Parsers.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1421,8 +1421,7 @@ self =>
14211421
else if (in.token == SYMBOLLIT) {
14221422
def msg(what: String) =
14231423
s"""symbol literal is $what; use Symbol("${in.strVal}") instead"""
1424-
if (settings.isScala3) syntaxError(in.offset, msg("unsupported"))
1425-
else deprecationWarning(in.offset, msg("deprecated"), "2.13.0")
1424+
deprecationWarning(in.offset, msg("deprecated"), "2.13.0")
14261425
Apply(scalaDot(nme.Symbol), List(finish(in.strVal)))
14271426
}
14281427
else finish(in.token match {

test/files/neg/symbol-literal-removal.check

Lines changed: 0 additions & 4 deletions
This file was deleted.

test/files/neg/symbol-literal-removal.scala

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)