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
Using a similar type hierarchy to #9398, the following code produces a spurious exhaustiveness warning.
sealedabstractclassTAsealedabstractclassTBextendsTAcaseobjectAextendsTAcaseobjectBextendsTBsealedtraitCcaseclassCTA(id: Int, da: TA) extendsCcaseclassCTB(id: Int, da: TB) extendsCvaltest:C=>Unit= {
caseCTA(_, A) =>caseCTA(_, B) =>caseCTB(_, B) =>
}
produces
match may not be exhaustive.
It would fail on the following input: CTB(_, _)
val test: C => Unit = {
The text was updated successfully, but these errors were encountered:
@retronym said:
My prototype fix for #9630 (linked from that ticket) also fixes this one. I'll update this ticket when we get that polished and merged.
A workaround is to avoid using the same name for the case class fields in sibling case classes.
sealedtraitCcaseclassCTA(id: Int, da: TA) extendsCcaseclassCTB(id1: Int, da1: TB) extendsC
Using a similar type hierarchy to #9398, the following code produces a spurious exhaustiveness warning.
produces
The text was updated successfully, but these errors were encountered: