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
In this example, elem is inferred to be of type Any instead of type X as in Scala 2:
objectTest {
deffoo[A<:X, B<:X, X](left: A, right: B):Unit= {
valelem=if (false) left else right
}
}
The issue is in TypeOps#approximateUnion, we approximate a union of types using the intersection of the base classes of the types, but that's not correct when the types are bounded by abstract types.
The text was updated successfully, but these errors were encountered:
In this example,
elem
is inferred to be of typeAny
instead of typeX
as in Scala 2:The issue is in
TypeOps#approximateUnion
, we approximate a union of types using the intersection of the base classes of the types, but that's not correct when the types are bounded by abstract types.The text was updated successfully, but these errors were encountered: