Return empty NotFixedToInferredTypesSubstitutor if the current substitutor is empty
This commit is contained in:
+5
-2
@@ -206,8 +206,11 @@ class BuilderInferenceSession(
|
|||||||
|
|
||||||
override fun currentConstraintSystem() = ConstraintStorage.Empty
|
override fun currentConstraintSystem() = ConstraintStorage.Empty
|
||||||
|
|
||||||
fun getNotFixedToInferredTypesSubstitutor(): NewTypeSubstitutor =
|
fun getNotFixedToInferredTypesSubstitutor(): NewTypeSubstitutor {
|
||||||
ComposedSubstitutor(commonSystem.buildCurrentSubstitutor() as NewTypeSubstitutor, createNonFixedTypeToVariableSubstitutor())
|
val currentSubstitutor =
|
||||||
|
commonSystem.buildCurrentSubstitutor().cast<NewTypeSubstitutor>().takeIf { !it.isEmpty } ?: return EmptySubstitutor
|
||||||
|
return ComposedSubstitutor(currentSubstitutor, createNonFixedTypeToVariableSubstitutor())
|
||||||
|
}
|
||||||
|
|
||||||
override fun inferPostponedVariables(
|
override fun inferPostponedVariables(
|
||||||
lambda: ResolvedLambdaAtom,
|
lambda: ResolvedLambdaAtom,
|
||||||
|
|||||||
Reference in New Issue
Block a user