rsc
rsc copied to clipboard
Simplify simple forSome existential types into wildcard existentials
Instead of ascribing
val x: Foo[X] forSome { type X }
we will ascribe
val x: Foo[_]
This is an old ticket and we don't have a reproduction for the issue or know if it is still valid so I am closing it for now.
Given:
class Box[A]
def foo = null.asInstanceOf[Box[_]]
Obtained:
def foo: Box[T1] forSome { type T1 } = null.asInstanceOf[Box[_]]
Expected:
def foo: Box[_] = null.asInstanceOf[Box[_]]
Relates to #471 and requires Box to be invariant.