FIR: Make constraint injector treat stub types as type variables

This commit is contained in:
Simon Ogorodnik
2021-11-14 16:06:45 +03:00
committed by teamcity
parent 19e2409284
commit 7b8ece8758
5 changed files with 15 additions and 2 deletions
@@ -293,7 +293,7 @@ class ConstraintInjector(
// from AbstractTypeCheckerContextForConstraintSystem
override fun isMyTypeVariable(type: SimpleTypeMarker): Boolean =
c.allTypeVariables.containsKey(type.typeConstructor())
c.allTypeVariables.containsKey(type.typeConstructor().unwrapStubTypeVariableConstructor())
override fun addUpperConstraint(typeVariable: TypeConstructorMarker, superType: KotlinTypeMarker) =
addConstraint(typeVariable, superType, UPPER)
@@ -326,7 +326,7 @@ class ConstraintInjector(
kind: ConstraintKind,
isFromNullabilityConstraint: Boolean = false
) {
val typeVariable = c.allTypeVariables[typeVariableConstructor]
val typeVariable = c.allTypeVariables[typeVariableConstructor.unwrapStubTypeVariableConstructor()]
?: error("Should by type variableConstructor: $typeVariableConstructor. ${c.allTypeVariables.values}")
addNewIncorporatedConstraint(