Closed
Description
Compiler version
3.0.0
Minimized code
package akka.event
sealed trait LogEvent
object LogEvent:
def myOrdinal(e: LogEvent): Int = e match
case e: Error => 0
// case e: Warning => 1
case e: LogEventWithMarker => 2
case class Error() extends LogEvent
class Error2() extends Error() with LogEventWithMarker
// case class Warning() extends LogEvent
sealed trait LogEventWithMarker extends LogEvent
Output
compiles fine
Expectation
there should be an unreachable warning for case e: LogEventWithMarker
, as which happens when we add another child to LogEvent (uncomment the lines in the example)