Skip to content

Self-assignment of this has been cruelly outlawed #18891

Open
@som-snytt

Description

@som-snytt

Compiler version

3.4.0-RC1-bin-SNAPSHOT-git-5454110

Minimized code

Welcome to Scala 3.4.0-RC1-bin-SNAPSHOT-git-5454110 (21, Java OpenJDK 64-Bit Server VM).
Type in expressions for evaluation. Or try :help.

scala> val this = this
-- [E040] Syntax Error: ------------------------------------------------------------------------------------------------
1 |val this = this
  |    ^
  |    an identifier expected, but 'this' found
  |
  | longer explanation available when compiling with `-explain`

scala>

Expectation

Don't disallow keywords which are patterns.

#12406

#18752

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:specbacklogNo work planned on this by the core team for the time being.itype:bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions