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(
1209
1209
* `parent` is null.
1210
1210
*/
1211
1211
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
+
1214
1221
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" )
1220
1224
}
1225
+
1221
1226
return " @\" params;{$parentId };$idx \" "
1222
1227
}
1223
1228
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments