Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: don't consider into as a soft-modifier #21924

Merged
merged 1 commit into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
}
Loading