FIR: postpone callable reference candidate in default argument case

#KT-53019 Fixed
This commit is contained in:
Mikhail Glukhikh
2022-06-29 16:55:41 +02:00
committed by Space
parent c36e160f24
commit c92d685415
14 changed files with 317 additions and 0 deletions
@@ -456,6 +456,19 @@ class FirCallResolver(
}
val chosenCandidate = reducedCandidates.single()
if (!resolvedCallableReferenceAtom.hasBeenPostponed &&
expectedType is ConeTypeVariableType &&
chosenCandidate.symbol.fir.let { func ->
func is FirSimpleFunction && func.valueParameters.any { param ->
param.defaultValue != null
}
}
) {
resolvedCallableReferenceAtom.hasBeenPostponed = true
return applicability to true
}
constraintSystemBuilder.runTransaction {
chosenCandidate.outerConstraintBuilderEffect!!(this)
true