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
traitNodes1 {
sealedtraitBfinalcaseclassR1() extendsB
}
traitNodes2extendsNodes1 {
finalcaseclassR2[T]() extendsB
}
objectImpl1extendsNodes1objecttest2 {
vala:Impl1.B=???
a match {
caseImpl1.R1() =>???
}
}
Output
$ ~/Downloads/scala3-3.7.2-x86_64-pc-linux/bin/scalac nodes.scala
-- [E029] PatternMatchExhaustivityWarning: nodes.scala:15:2----------------------------------------------------------------15| a match {
|^|match may not be exhaustive.
||It would fail on pattern case: (Nodes2&Impl1.type)#R2()
|| longer explanation available when compiling with`-explain`1 warning found
Expectation
No warnings is produced.
Since Impl1.type is a object instances of Nodes2 & Impl1.type does not exist. Remove the type parameter from R2 makes the warning go away.