Skip to content

Backquote quirk in patternΒ #24162

Closed

Description

@som-snytt

Compiler version

3.7.3

Minimized code

scala> i match { case `-`42 => "yay" }
[[syntax trees at end of                     typer]] // rs$line$3
package <empty> {
  final lazy module val rs$line$3: rs$line$3 = new rs$line$3()
  final module class rs$line$3() extends Object() { this: rs$line$3.type =>
    val res1: String =
      i match
        {
          case -42 =>
            "yay"
        }
  }
}

val res1: String = yay

Expectation

The backquoted hyphen is not minus.

Activity

  1. self-assigned this
    on Oct 9, 2025
  2. removed their assignment
    on Mar 31, 2026
  3. added a commit that references this issue on May 12, 2026
    21dd6a6
  4. added this to the 3.9.0 milestone on May 26, 2026
  5. added a commit that references this issue on Jun 5, 2026
    c2ecc8f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions