FIR: transform other parts of function call even though callee is an error

This commit is contained in:
Jinseong Jeon
2021-02-09 22:11:13 -08:00
committed by Mikhail Glukhikh
parent 27c942a0ff
commit a841a0bbca
3 changed files with 11 additions and 4 deletions
@@ -262,7 +262,14 @@ open class FirExpressionsResolveTransformer(transformer: FirBodyResolveTransform
if (functionCall.calleeReference is FirResolvedNamedReference && functionCall.resultType is FirImplicitTypeRef) {
storeTypeFromCallee(functionCall)
}
if (functionCall.calleeReference !is FirSimpleNamedReference) return functionCall.compose()
if (functionCall.calleeReference !is FirSimpleNamedReference) {
// The callee reference can be resolved as an error very early, e.g., `super` as a callee during raw FIR creation.
// We still need to visit/transform other parts, e.g., call arguments, to check if any other errors are there.
if (functionCall.calleeReference !is FirResolvedNamedReference) {
functionCall.transformChildren(transformer, data)
}
return functionCall.compose()
}
if (functionCall.calleeReference is FirNamedReferenceWithCandidate) return functionCall.compose()
dataFlowAnalyzer.enterCall()
functionCall.transformAnnotations(transformer, data)