Skip to content

Exception while typechecking and compiling pattern matching with @ #1716

Closed
@vuspenskiy

Description

@vuspenskiy
object Fail {
  case class So[+T]()

  def main(args: Array[String]): Unit = {
    So[Int]() match {
      case p@So[_] => Console.println("Yep")
      case _       => Console.println("Nope")
    }
  }
}

Compiler says,

exception occurred while typechecking /path/to/Src.scala
exception occurred while compiling /path/to/Src.scala

Works well if underscore in pattern matching is replaced with a specific type.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions