[NI] Strip only Exact-annotation preserving others during inference

This commit is contained in:
Mikhail Zarechenskiy
2019-04-18 14:41:24 +03:00
parent 3f08753f87
commit 8f8e33f251
4 changed files with 13 additions and 2 deletions
@@ -45,8 +45,8 @@ abstract class AbstractTypeCheckerContextForConstraintSystem : AbstractTypeCheck
val hasExact = subType.isTypeVariableWithExact() || superType.isTypeVariableWithExact()
// we should strip annotation's because we have incorporation operation and they should be not affected
val mySubType = if (hasExact) subType.removeAnnotations() else subType
val mySuperType = if (hasExact) superType.removeAnnotations() else superType
val mySubType = if (hasExact) subType.removeExactAnnotation() else subType
val mySuperType = if (hasExact) superType.removeExactAnnotation() else superType
val result = internalAddSubtypeConstraint(mySubType, mySuperType)
if (!hasExact) return result