File tree Expand file tree Collapse file tree 3 files changed +12
-194
lines changed
kotlin-extractor/src/main/kotlin
ql/test/kotlin/library-tests/extensions Expand file tree Collapse file tree 3 files changed +12
-194
lines changed Original file line number Diff line number Diff line change @@ -1209,15 +1209,20 @@ open class KotlinUsesExtractor(
12091209 * `parent` is null.
12101210 */
12111211 fun getValueParameterLabel (vp : IrValueParameter , parent : Label <out DbCallable >? ): String {
1212- val parentId = parent ? : useDeclarationParent(vp.parent, false )
1213- val idx = vp.index
1212+ val declarationParent = vp.parent
1213+ val parentId = parent ? : useDeclarationParent(declarationParent, false )
1214+
1215+ val idx = if (declarationParent is IrFunction && declarationParent.extensionReceiverParameter != null )
1216+ // For extension functions increase the index to match what the java extractor sees:
1217+ vp.index + 1
1218+ else
1219+ vp.index
1220+
12141221 if (idx < 0 ) {
1215- val p = vp.parent
1216- if (p !is IrFunction || p.extensionReceiverParameter != vp) {
1217- // We're not extracting this and this@TYPE parameters of functions:
1218- logger.error(" Unexpected negative index for parameter" )
1219- }
1222+ // We're not extracting this and this@TYPE parameters of functions:
1223+ logger.error(" Unexpected negative index for parameter" )
12201224 }
1225+
12211226 return " @\" params;{$parentId };$idx \" "
12221227 }
12231228
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments