FIR: strengthen resolution success check for augmented array set call

This commit removes some false ambiguities &
fixes compilation of tree-generator module with FIR
This commit is contained in:
Jinseong Jeon
2020-12-18 00:06:46 -08:00
committed by TeamCityServer
parent 9bf2dfaa02
commit 9c2d06cf70
8 changed files with 88 additions and 73 deletions
@@ -867,8 +867,11 @@ open class FirExpressionsResolveTransformer(transformer: FirBodyResolveTransform
}
val secondResult = augmentedArraySetCall.assignCall.transformSingle(transformer, ResolutionMode.ContextIndependent)
val firstSucceed = firstCalls.all { it.typeRef !is FirErrorTypeRef }
val secondSucceed = secondCalls.all { it.typeRef !is FirErrorTypeRef }
fun isSuccessful(functionCall: FirFunctionCall): Boolean =
functionCall.typeRef !is FirErrorTypeRef && functionCall.calleeReference is FirResolvedNamedReference
val firstSucceed = firstCalls.all(::isSuccessful)
val secondSucceed = secondCalls.all(::isSuccessful)
val result: FirStatement = when {
firstSucceed && secondSucceed -> {