Get rid of originalToVariableSubstitutor and descriptorToVariable
Move the composite substitutor to GenericCandidateResolver where it was used, other places don't need it since they know the exact call (or NO_CALL), the substitutor for which should be used
This commit is contained in:
@@ -118,17 +118,14 @@ class FuzzyType(
|
||||
val builder = ConstraintSystemBuilderImpl()
|
||||
val typeVariableSubstitutor = builder.registerTypeVariables(CallHandle.NONE, freeParameters + otherType.freeParameters)
|
||||
|
||||
val typeInSystem = typeVariableSubstitutor.substitute(type, Variance.INVARIANT)
|
||||
val otherTypeInSystem = typeVariableSubstitutor.substitute(otherType.type, Variance.INVARIANT)
|
||||
|
||||
when (matchKind) {
|
||||
MatchKind.IS_SUBTYPE -> builder.addSubtypeConstraint(
|
||||
typeVariableSubstitutor.substitute(type, Variance.INVARIANT),
|
||||
otherType.type,
|
||||
ConstraintPositionKind.RECEIVER_POSITION.position()
|
||||
)
|
||||
MatchKind.IS_SUPERTYPE -> builder.addSubtypeConstraint(
|
||||
typeVariableSubstitutor.substitute(otherType.type, Variance.INVARIANT),
|
||||
type,
|
||||
ConstraintPositionKind.RECEIVER_POSITION.position()
|
||||
)
|
||||
MatchKind.IS_SUBTYPE ->
|
||||
builder.addSubtypeConstraint(typeInSystem, otherTypeInSystem, ConstraintPositionKind.RECEIVER_POSITION.position())
|
||||
MatchKind.IS_SUPERTYPE ->
|
||||
builder.addSubtypeConstraint(otherTypeInSystem, typeInSystem, ConstraintPositionKind.RECEIVER_POSITION.position())
|
||||
}
|
||||
|
||||
builder.fixVariables()
|
||||
|
||||
Reference in New Issue
Block a user