Introduce specific error for calls which could be resolved only with unrestricted builder inference

^KT-47747 Fixed
This commit is contained in:
Victor Petukhov
2021-07-15 12:57:31 +03:00
committed by teamcityserver
parent 357fda2efa
commit 6a1ec92d39
15 changed files with 38 additions and 11 deletions
@@ -241,7 +241,9 @@ class ConstraintSystemCompleter(private val components: BodyResolveComponents) {
findResolvedAtomBy(typeVariable, topLevelAtoms) ?: topLevelAtoms.firstOrNull()
if (resolvedAtom != null) {
c.addError(NotEnoughInformationForTypeParameter(typeVariable, resolvedAtom))
c.addError(
NotEnoughInformationForTypeParameter(typeVariable, resolvedAtom, c.couldBeResolvedWithUnrestrictedBuilderInference())
)
}
val resultErrorType = when (typeVariable) {