Skip to content

Accessing backqouted underscore does not parse but compiles fine in Scala 2.13.x  #14746

Open
@romanowski

Description

@romanowski

Compiler version

I tested with3.1.1 but it probably applies to all Scala 3 / dotty versions

Minimized code

//> using lib "com.lihaoyi:scalaparse_2.13:2.3.3"

import fastparse._

class U extends App {
  def a[T: P] = scalaparse.Scala.`_` 
                                                    // ^ fails here with: wildcard invalid as backquoted identifier
}

Output

Compiles on Scala 2.13.8, fails on 3.1.1 with:

[error] ./underscore.scala:6:34: wildcard invalid as backquoted identifier
[error]   def a[T: P] = scalaparse.Scala.`_`
[error]                                  ^
Error compiling project (Scala 3.1.1, JVM)

Expectation

I know that_ is not the best name of the method, however, it exists and is used e.g. in Scala CLI.

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