First steps to make distinction between variables and descriptors in ConstraintSystem

A type variable is an entity, the value of which should be solved by the
system; a descriptor is an actual TypeParameterDescriptor declaration
This commit is contained in:
Alexander Udalov
2015-11-02 15:56:02 +03:00
parent eeb925f127
commit 13abc265ad
6 changed files with 56 additions and 49 deletions
@@ -138,7 +138,7 @@ class FuzzyType(
if (otherSubstitutedType.isError) return null
if (!substitutedType.checkInheritance(otherSubstitutedType)) return null
val substitution = constraintSystem.typeVariables.toMap({ it.typeConstructor }) {
val substitution = constraintSystem.typeParameterDescriptors.toMap({ it.typeConstructor }) {
val type = it.defaultType
val solution = substitutor.substitute(type, Variance.INVARIANT)
TypeProjectionImpl(if (solution != null && !ErrorUtils.containsUninferredParameter(solution)) solution else type)