FIR: Register type variables properly in builder inference
This commit is contained in:
committed by
teamcity
parent
0d9ed6990e
commit
64944a1247
+2
-2
@@ -181,7 +181,7 @@ class FirBuilderInferenceSession(
|
||||
nonFixedToVariablesSubstitutor: ConeSubstitutor,
|
||||
shouldIntegrateAllConstraints: Boolean
|
||||
): Boolean {
|
||||
storage.notFixedTypeVariables.values.forEach { commonSystem.registerVariable(it.typeVariable) }
|
||||
storage.notFixedTypeVariables.values.forEach { commonSystem.registerTypeVariableIfNotPresent(it.typeVariable) }
|
||||
|
||||
/*
|
||||
* storage can contain the following substitutions:
|
||||
@@ -224,7 +224,7 @@ class FirBuilderInferenceSession(
|
||||
if (shouldIntegrateAllConstraints) {
|
||||
for ((variableConstructor, type) in storage.fixedTypeVariables) {
|
||||
val typeVariable = storage.allTypeVariables.getValue(variableConstructor)
|
||||
commonSystem.registerVariable(typeVariable)
|
||||
commonSystem.registerTypeVariableIfNotPresent(typeVariable)
|
||||
commonSystem.addEqualityConstraint((typeVariable as ConeTypeVariable).defaultType, type, BuilderInferencePosition)
|
||||
introducedConstraint = true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user