Skip to content

Backquoted == operator not treat as stable identifier during pattern match. #18247

@jilen

Description

@jilen

Compiler version

3.3.0

Minimized code

sealed trait Op
object Op {
  case object `==` extends Op
}

def `is_==`(a: Op): true = {
  a match {
    case Op.`==` => true // won't compile
  }
}

Note other operators like +, - works just fine.

Output

 Stable identifier required, but Playground.Op.== found

Expectation

Should compile fine.

Workaround

Bind it to a constant

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions