Skip to content

Commit

Permalink
fix: don't consider into as a soft-modifier
Browse files Browse the repository at this point in the history
Co-authored-by: kasiaMarek <[email protected]>
Co-authored-by: KacperFKorban <[email protected]>
  • Loading branch information
3 people committed Nov 11, 2024
1 parent 7f141a9 commit 04934b7
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/parsing/Tokens.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
6 changes: 6 additions & 0 deletions tests/neg/i21786.check
Original file line number Diff line number Diff line change
@@ -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`
1 change: 1 addition & 0 deletions tests/neg/i21786.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
into class X // error
6 changes: 6 additions & 0 deletions tests/pos/i21635.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class A(val into: Boolean) {
def m1(): Any =
into

def m2(): Int = 1
}

0 comments on commit 04934b7

Please sign in to comment.