Closed
Description
Compiler version
3.5.2
https://scastie.scala-lang.org/7iPISGKwTfOBxOKWIRIiaw
Minimized code
trait Figure
sealed trait Corners {
self: Figure =>
}
enum Shape extends Figure:
case Triange extends Shape with Corners
case Square extends Shape with Corners
case Circle extends Shape
case Ellipsis extends Shape
def hasCorners(s: Shape): Boolean = s match
case hasCorners: Corners => true // <--- reported as `Unreachable case`
case _ => false
println(hasCorners(Shape.Circle))
Output
warning: Unreachable case
true
Expectation
true