Closed
Description
Compiler version
3.4.0-RC4
Minimized code
trait Foo
trait Bar[T]
type MatchType[T] = T match
case Bar[?] => Nothing
case _ => T
def foo(b: Bar[? >: Foo]): MatchType[b.type] = ???
def bar(b: Bar[? >: Foo]): Nothing = foo(b)
Compiler output
Found: MatchType[(b : Bar[? >: Foo])]
Required: Nothing
Note: a match type could not be fully reduced:
trying to reduce MatchType[(b : Bar[? >: Foo])]
failed since selector (b : Bar[? >: Foo])
does not match case Bar[_] => Nothing
and cannot be shown to be disjoint from it either.
Therefore, reduction cannot advance to the remaining case
case _ => (b : Bar[? >: Foo])
Expectation
No compile error