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
typeIllegalMatch1[T] =Tmatch {
caseInt=> java.lang.Integercase a |Null=> a
case _ =>T
}
typeIllegalMatch2[T] =Tmatch {
case a |Null=> a
case _ =>T
}
Output
-- [E191] TypeError:Stest.scala:84:26----------------------------------------84|typeIllegalMatch2[T] =Tmatch {
|^|Thematchtypecontains an illegal case:|case a |Null=> a
| (this error can be ignored for now with`-source:3.3`)
85|case a |Null=> a
86|case _ =>T87|}
Expectation
case a | Null => ??? is an illegal case based on the specification of match types (#18262).
The illegal cases in both IllegalMatch1 and IllegalMatch2 should be reported at the definition site.