Skip to content

Commit c684200

Browse files
authored
Merge pull request #86 from scala/backport-lts-3.3-21924
Backport "fix: don't consider `into` as a soft-modifier" to 3.3 LTS
2 parents a4eb10a + 31f39a7 commit c684200

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

compiler/src/dotty/tools/dotc/parsing/Tokens.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ object Tokens extends TokensCommon {
294294

295295
final val closingParens = BitSet(RPAREN, RBRACKET, RBRACE)
296296

297-
final val softModifierNames = Set(nme.inline, nme.into, nme.opaque, nme.open, nme.transparent, nme.infix)
297+
final val softModifierNames = Set(nme.inline, nme.opaque, nme.open, nme.transparent, nme.infix)
298298

299299
def showTokenDetailed(token: Int): String = debugString(token)
300300

tests/neg/i21786.check

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
-- [E103] Syntax Error: tests/neg/i21786.scala:1:0 ---------------------------------------------------------------------
2+
1 |into class X // error
3+
|^^^^
4+
|Illegal start of toplevel definition
5+
|
6+
| longer explanation available when compiling with `-explain`

tests/neg/i21786.scala

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
into class X // error

tests/pos/i21635.scala

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
class A(val into: Boolean) {
2+
def m1(): Any =
3+
into
4+
5+
def m2(): Int = 1
6+
}

0 commit comments

Comments
 (0)