We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Given:
class Box[A] trait T class A extends T class B extends T val foo = Seq(new Box[A], new Box[B])
Obtained:
val foo: Seq[Box[_1] forSome { type _1 >: B with A <: T }] = Seq(new Box[A], new Box[B])
This will occur because Box is invariant.
Box
Expected?:
val foo: Seq[Box[_ <: T]] = Seq(new Box[A], new Box[B])
i.e. we perhaps should expect something like _ <: LeastCommonAncestor. If that is AnyRef, maybe we should only ascribe Box[_].
_ <: LeastCommonAncestor
AnyRef
Box[_]
The text was updated successfully, but these errors were encountered:
Simplify forSome statements into wildcard existentials (fix twitter#471)
e68af7d
No branches or pull requests
Given:
Obtained:
This will occur because
Box
is invariant.Expected?:
i.e. we perhaps should expect something like
_ <: LeastCommonAncestor
. If that isAnyRef
, maybe we should only ascribeBox[_]
.The text was updated successfully, but these errors were encountered: