Skip to content

regression in pattern viability checking #7655

Open
@scabug

Description

@scabug

Correctly errors out in 2.9, compiles without warning in 2.10.

object Test {
  sealed trait Foo
  object Bar extends Foo

  def f(x: Foo) = x match {
    case scala.Right => true
    case _           => false
  }
}
// scala 2.9
// ./a.scala:9: error: pattern type is incompatible with expected type;
//  found   : object Right
//  required: Test.Foo
//     case scala.Right => true
//                ^
// one error found

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions