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
typeA[X] =XmatchcaseInt=>Intcase _ =>B[X]
defa[X](x: X):A[X] = x matchcasev: Int=> v
case _ => b(x)
typeB[X] =XmatchcaseString=>Stringdefb[X](x: X):B[X] = x matchcasev: String=> v
problem
fails to compile:
Found: (v : X & Int)
Required: Playground.A[X]
Found: Playground.B[X]
Required: Playground.A[X]
with some casts it works:
typeA[X] =XmatchcaseInt=>Intcase _ =>B[X]
defa[X](x: X):A[X] = (x matchcasev: Int=> v
case _ => b(x)
).asInstanceOf[A[X]]
typeB[X] =XmatchcaseString=>Stringdefb[X](x: X):B[X] = x matchcasev: String=> v
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
reproduction steps
using Scala 3.1.0,
problem
fails to compile:
with some casts it works:
The text was updated successfully, but these errors were encountered: