Cleanup constraint system, convert functions to properties, delete unused

This commit is contained in:
Alexander Udalov
2015-10-30 16:39:40 +03:00
parent 3484c049d1
commit d72a4c8037
16 changed files with 64 additions and 188 deletions
@@ -129,15 +129,15 @@ class FuzzyType(
val constraintSystem = builder.build()
if (constraintSystem.getStatus().hasContradiction()) return null
if (constraintSystem.status.hasContradiction()) return null
// currently ConstraintSystem return successful status in case there are problems with nullability
// that's why we have to check subtyping manually
val substitutor = constraintSystem.getResultingSubstitutor()
val substitutor = constraintSystem.resultingSubstitutor
val substitutedType = substitutor.substitute(type, Variance.INVARIANT) ?: return null
if (substitutedType.isError) return null
val otherSubstitutedType = substitutor.substitute(otherType.type, Variance.INVARIANT) ?: return null
if (otherSubstitutedType.isError) return null
return if (substitutedType.checkInheritance(otherSubstitutedType)) constraintSystem.getPartialSubstitutor() else null
return if (substitutedType.checkInheritance(otherSubstitutedType)) constraintSystem.partialSubstitutor else null
}
}