Skip to content

No warnings for union type test pattern #8742

Closed
@liufengyun

Description

@liufengyun

Minimized code

class A
class B
class C

object Test {
  def bar(x: A) = x match {
    case x: (B | C) => x // no warning?
    case _ =>
  }
}

Output

No warnings

Expectation

The compiler should produce a warning, as the test is always false.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions