Do not report negative index warning on extension parameters

This commit is contained in:
Tamas Vajk
2022-01-25 15:49:09 +01:00
committed by Ian Lynagh
parent 8d15d0acfb
commit 4c68b583de

View File

@@ -989,8 +989,11 @@ open class KotlinUsesExtractor(
val parentId = parent ?: useDeclarationParent(vp.parent, false)
val idx = vp.index
if (idx < 0) {
// We're not extracting this and this@TYPE parameters of functions:
logger.warn(Severity.ErrorSevere, "Unexpected negative index for parameter")
val p = vp.parent
if (p !is IrFunction || p.extensionReceiverParameter != vp) {
// We're not extracting this and this@TYPE parameters of functions:
logger.warn(Severity.ErrorSevere, "Unexpected negative index for parameter")
}
}
return "@\"params;{$parentId};$idx\""
}