Introduce specific error for calls which could be resolved only with unrestricted builder inference
^KT-47747 Fixed
This commit is contained in:
committed by
teamcityserver
parent
357fda2efa
commit
6a1ec92d39
+1
@@ -148,6 +148,7 @@ class PostponedArgumentsAnalyzer(
|
||||
|
||||
if (hasInapplicableCallForBuilderInference) {
|
||||
inferenceSession?.initializeLambda(lambda)
|
||||
c.getBuilder().markCouldBeResolvedWithUnrestrictedBuilderInference()
|
||||
c.getBuilder().removePostponedVariables()
|
||||
return
|
||||
}
|
||||
|
||||
+3
-1
@@ -316,7 +316,9 @@ class KotlinConstraintSystemCompleter(
|
||||
val resolvedAtom = findResolvedAtomBy(typeVariable, topLevelAtoms) ?: topLevelAtoms.firstOrNull()
|
||||
|
||||
if (resolvedAtom != null) {
|
||||
c.addError(NotEnoughInformationForTypeParameterImpl(typeVariable, resolvedAtom))
|
||||
c.addError(
|
||||
NotEnoughInformationForTypeParameterImpl(typeVariable, resolvedAtom, c.couldBeResolvedWithUnrestrictedBuilderInference())
|
||||
)
|
||||
}
|
||||
|
||||
val resultErrorType = when {
|
||||
|
||||
+3
-2
@@ -54,5 +54,6 @@ class DelegatedPropertyConstraintPositionImpl(topLevelCall: KotlinCall) : Delega
|
||||
|
||||
class NotEnoughInformationForTypeParameterImpl(
|
||||
typeVariable: TypeVariableMarker,
|
||||
resolvedAtom: ResolvedAtom
|
||||
) : NotEnoughInformationForTypeParameter<ResolvedAtom>(typeVariable, resolvedAtom)
|
||||
resolvedAtom: ResolvedAtom,
|
||||
couldBeResolvedWithUnrestrictedBuilderInference: Boolean
|
||||
) : NotEnoughInformationForTypeParameter<ResolvedAtom>(typeVariable, resolvedAtom, couldBeResolvedWithUnrestrictedBuilderInference)
|
||||
|
||||
Reference in New Issue
Block a user