-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
area:pattern-matchingarea:reportingError reporting including formatting, implicit suggestions, etcError reporting including formatting, implicit suggestions, etcitype:bugregressionThis worked in a previous version but doesn't anymoreThis worked in a previous version but doesn't anymore
Milestone
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
Metadata
Metadata
Labels
area:pattern-matchingarea:reportingError reporting including formatting, implicit suggestions, etcError reporting including formatting, implicit suggestions, etcitype:bugregressionThis worked in a previous version but doesn't anymoreThis worked in a previous version but doesn't anymore