[NI] Add collecting forgotten type variables from callable references
#KT-35959 Fixed
This commit is contained in:
+4
-1
@@ -241,7 +241,10 @@ class KotlinConstraintSystemCompleter(
|
||||
fun ResolvedAtom.process(to: LinkedHashSet<TypeConstructor>) {
|
||||
val typeVariables = when (this) {
|
||||
is ResolvedCallAtom -> freshVariablesSubstitutor.freshVariables
|
||||
is CallableReferenceWithTypeVariableAsExpectedTypeAtom -> listOfNotNull(typeVariableForReturnType)
|
||||
is CallableReferenceWithTypeVariableAsExpectedTypeAtom -> mutableListOf<NewTypeVariable>().apply {
|
||||
addIfNotNull(typeVariableForReturnType)
|
||||
addAll(candidate?.freshSubstitutor?.freshVariables.orEmpty())
|
||||
}
|
||||
is ResolvedCallableReferenceAtom -> candidate?.freshSubstitutor?.freshVariables.orEmpty()
|
||||
is ResolvedLambdaAtom -> listOfNotNull(typeVariableForLambdaReturnType)
|
||||
else -> emptyList()
|
||||
|
||||
Reference in New Issue
Block a user