Skip to content

Type erased after pattern matching #10346

@Atry

Description

@Atry
Welcome to Scala 2.12.2 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_131).
Type in expressions for evaluation. Or try :help.

scala> Some(1)  match {
     | case s: Option[_] =>
     | s
     | } 
res0: Some[Int] = Some(1)

scala> Some(1)  match {
     | case s: Some[_] =>
     | s
     | } 
res1: Some[Any] = Some(1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixed in Scala 3This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/)inferpatmat

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions