Skip to content

Missing unreachable match warning with only two cases #12559

Closed
@bishabosha

Description

@bishabosha

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)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions