Add call to type variable and mapping descriptor -> variable

Since type parameter descriptor represents a single declaration of a type
parameter, multiple variables in one system may correspond to one type
parameter (e.g. in case of nested calls). Hence it's not possible to map type
parameters uniquely onto type variables and additional information is required
This commit is contained in:
Alexander Udalov
2015-11-11 20:24:13 +03:00
parent fc73e8c620
commit 178ca3daae
14 changed files with 83 additions and 36 deletions
@@ -20,6 +20,7 @@ package org.jetbrains.kotlin.idea.util
import org.jetbrains.kotlin.descriptors.CallableDescriptor
import org.jetbrains.kotlin.descriptors.TypeParameterDescriptor
import org.jetbrains.kotlin.resolve.calls.inference.CallHandle
import org.jetbrains.kotlin.resolve.calls.inference.ConstraintSystemBuilderImpl
import org.jetbrains.kotlin.resolve.calls.inference.constraintPosition.ConstraintPositionKind
import org.jetbrains.kotlin.types.*
@@ -115,7 +116,7 @@ class FuzzyType(
}
val builder = ConstraintSystemBuilderImpl()
val typeVariableSubstitutor = builder.registerTypeVariables(freeParameters + otherType.freeParameters)
val typeVariableSubstitutor = builder.registerTypeVariables(CallHandle.NONE, freeParameters + otherType.freeParameters)
when (matchKind) {
MatchKind.IS_SUBTYPE -> builder.addSubtypeConstraint(