[NI] Don't consider Any!-constraint from upper bounds as more specific

#KT-31624 Fixed
This commit is contained in:
Mikhail Zarechenskiy
2019-05-27 13:18:59 +03:00
parent 8bef345f0f
commit c30e045b1b
6 changed files with 90 additions and 6 deletions
@@ -101,12 +101,10 @@ class ConstraintInjector(val constraintIncorporator: ConstraintIncorporator, val
return true // T <: T(?!)
}
if (constraintType.isSimpleType()) {
if (constraint.position.from is DeclaredUpperBoundConstraintPosition &&
constraint.kind == UPPER && constraintType.isNullableAny()
) {
return true // T <: Any?
}
if (constraint.position.from is DeclaredUpperBoundConstraintPosition &&
constraint.kind == UPPER && constraintType.isNullableAny()
) {
return true // T <: Any?
}
return false