Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4c68b58

Browse files
tamasvajkigfoo
authored andcommitted
Do not report negative index warning on extension parameters
1 parent 8d15d0a commit 4c68b58

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

java/kotlin-extractor/src/main/kotlin/KotlinUsesExtractor.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -989,8 +989,11 @@ open class KotlinUsesExtractor(
989989
val parentId = parent ?: useDeclarationParent(vp.parent, false)
990990
val idx = vp.index
991991
if (idx < 0) {
992-
// We're not extracting this and this@TYPE parameters of functions:
993-
logger.warn(Severity.ErrorSevere, "Unexpected negative index for parameter")
992+
val p = vp.parent
993+
if (p !is IrFunction || p.extensionReceiverParameter != vp) {
994+
// We're not extracting this and this@TYPE parameters of functions:
995+
logger.warn(Severity.ErrorSevere, "Unexpected negative index for parameter")
996+
}
994997
}
995998
return "@\"params;{$parentId};$idx\""
996999
}

0 commit comments

Comments
 (0)