Skip to content

TypeTest exhaustivity check #12026

Closed
@nicolasstucki

Description

@nicolasstucki

Compiler version

3.0.0-RC2

Minimized code

def test[A, B](a: A|B)(using reflect.TypeTest[Any, A], reflect.TypeTest[Any, B]) =
  a match {  // WARNING: match may not be exhaustive. It would fail on pattern case: _: A, _: B
    case a: A =>
    case b: B =>
  }

Output

match may not be exhaustive. It would fail on pattern case: _: A, _: B

Expectation

Should not warn.

A call to TypeTest.unapply should match all A as an a: A would if A was concrete, therefore it covers the type A. Same for B.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions