Fix missing extension receiver extraction

This commit is contained in:
Tamas Vajk
2021-11-26 14:44:21 +01:00
committed by Ian Lynagh
parent 23c5caadc8
commit 874afa7fd7
2 changed files with 12 additions and 1 deletions

View File

@@ -687,9 +687,17 @@ open class KotlinFileExtractor(
}
val dr = c.dispatchReceiver
if(dr != null) {
val er = c.extensionReceiver
if (dr != null) {
extractExpressionExpr(dr, callable, id, -1, enclosingStmt)
if (er != null && er != dr) {
logger.warnElement(Severity.ErrorSevere, "Expected to only find extension receiver or dispatch receiver. Found both. Extracting dispatch receiver only", c)
}
} else if (er != null) {
extractExpressionExpr(er, callable, id, -1, enclosingStmt)
}
for(i in 0 until c.valueArgumentsCount) {
val arg = c.getValueArgument(i)
if(arg != null) {