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
3.2.1-RC1-bin-20220831-398b72e-NIGHTLY
compiles without warnings with 3.2.0-RC1
Minimized code
sealedtraitT[-U]
finalcaseclassC[U]() extendsT[U]
deff[U](ua: T[U]) = ua match {
caseua: C[U] @unchecked =>???
}
Output
[warn] ./turboliftbug.scala:4:22:match may not be exhaustive.
[warn]
[warn] It would fail on pattern case:C()
[warn] deff[U](ua: T[U]) = ua match {
[warn] ^^
Expectation
No warning. (possibly)
I'm not 100% sure if the warning is correct or not. But this is a CB (#15949) fail, so decided to create an issue either way.
My reasoning is: Since C.U is invariant and T.U is contravariant, then the match can still fail on C[Any].
Though scala 2.13.8 doesn't give a warning here.