You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here is an example where Dotty incorrectly reports an unreachable case in pattern marching:
objectTest {
// shapeless.CoproductsealedtraitCoproductextendsProductwithSerializablesealedtrait:+:[+H, +T<:Coproduct] extendsCoproductfinalcaseclassInl[+H, +T<:Coproduct](head : H) extends:+:[H, T]
finalcaseclassInr[+H, +T<:Coproduct](tail : T) extends:+:[H, T]
sealedtraitCNilextendsCoproduct// Note that this only appears when T is a type parameter. Replaying T with// a concrete type (CNil or another :+:) leads to accurate warnningsdeff[T<:Coproduct](fa: Int:+:T) =
fa match {
caseInl(x) =>1caseInr(x) =>2// Dotty thinks this unreachable, but it is!
}
defmain(args: Array[String]):Unit=
assert(f(Inr(Inl(-1))) ==2) // Example of reachability
}
The text was updated successfully, but these errors were encountered:
Here is an example where Dotty incorrectly reports an unreachable case in pattern marching:
The text was updated successfully, but these errors were encountered: