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
importscala.quoted.*traitA:typeB<:CtypeCdeftakesC[X<:C] =???deff(usingQuotes) = {
importquotes.reflect.*'{newA {}} match {
case'{ $a : A { typeB= b } } =>
takesC[b]
}
}
Output
-- [E057] TypeMismatchError: tests/pos/type-bound-match.scala:13:13--------------------------------------------------13| takesC[b]
|^|Type argument b does not conform to upper bound C
Expectation
No error.
Workaround:
//...'{newA {}} match {
case'{ typeb<:C; $a : A { typeB= `b` } } =>
takesC[b]
}
//...
The text was updated successfully, but these errors were encountered:
nicolasstucki
changed the title
Pattern matching quoted type alias doesn't copy type bounds
Pattern matching type variable does not infer bounds
Sep 15, 2021
Uh oh!
There was an error while loading. Please reload this page.
Compiler version
master
Minimized code
Output
Expectation
No error.
Workaround:
The text was updated successfully, but these errors were encountered: