Open
Description
Given:
class Contra[-T >: Null]
object Test {
def foo = {
class A
new Contra[A]
}
}
The inferred type of foo
is Contra[Nothing]
, but this isn't a legal type (and indeed writing it down would produce a Type argument Nothing does not conform to lower bound Null
error).
It seems that ApproximatingTypeMap#derivedAppliedType
is missing logic to replace Ranges by types which are in bounds. Moreover, -Ycheck
should be enhanced to detect this kind of bound violations.