Closed
Description
In some situations, matching on a sealed abstract class using a type annotation will cause the compiler to warn about unreachable code
sealed trait Foo
class Bar(val s: String) extends Foo
sealed abstract class Baz(val s: String) extends Foo
val f: Foo => String = {
case bar: Bar => bar.s
case baz: Baz => baz.s
}
This warning does not happen if the case for the sealed abstract class comes first.