Closed
Description
Minimized code
inline def aToB[T,A,B](t:T,b:B): T|B = t match {
case _:A => b
case _:T => t
}
@main def main() = aToB[Int, Double, String](1,"x")
Output
❌ this case is unreachable since type Int
is not a subclass of class Double
Expectation
A warning? User of the inlined method would be hardly able to do anything about it if it came from a library.
Moreover, is a dead branch of match statement really worth a compile error? Non-exhaustive matches, which seem more serious to me, are just warnings now.