diff --git a/compiler/src/dotty/tools/dotc/parsing/Tokens.scala b/compiler/src/dotty/tools/dotc/parsing/Tokens.scala index b0a533b2f1df..c78a336ecdf5 100644 --- a/compiler/src/dotty/tools/dotc/parsing/Tokens.scala +++ b/compiler/src/dotty/tools/dotc/parsing/Tokens.scala @@ -297,7 +297,7 @@ object Tokens extends TokensCommon { final val closingParens = BitSet(RPAREN, RBRACKET, RBRACE) - final val softModifierNames = Set(nme.inline, nme.into, nme.opaque, nme.open, nme.transparent, nme.infix) + final val softModifierNames = Set(nme.inline, nme.opaque, nme.open, nme.transparent, nme.infix) def showTokenDetailed(token: Int): String = debugString(token) diff --git a/tests/neg/i21786.check b/tests/neg/i21786.check new file mode 100644 index 000000000000..47f7e2456c3d --- /dev/null +++ b/tests/neg/i21786.check @@ -0,0 +1,6 @@ +-- [E103] Syntax Error: tests/neg/i21786.scala:1:0 --------------------------------------------------------------------- +1 |into class X // error + |^^^^ + |Illegal start of toplevel definition + | + | longer explanation available when compiling with `-explain` diff --git a/tests/neg/i21786.scala b/tests/neg/i21786.scala new file mode 100644 index 000000000000..c5bb9c595d32 --- /dev/null +++ b/tests/neg/i21786.scala @@ -0,0 +1 @@ +into class X // error diff --git a/tests/pos/i21635.scala b/tests/pos/i21635.scala new file mode 100644 index 000000000000..dc0a8314c7d8 --- /dev/null +++ b/tests/pos/i21635.scala @@ -0,0 +1,6 @@ +class A(val into: Boolean) { + def m1(): Any = + into + + def m2(): Int = 1 +}