File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
kotlin-extractor/src/main/kotlin
ql/integration-tests/posix-only/kotlin/kotlin_kfunction Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -1318,6 +1318,14 @@ open class KotlinFileExtractor(
13181318 val receiverClass = receiverType.classifier.owner as ? IrClass ? : return listOf ()
13191319 val ancestorTypes = ArrayList <IrSimpleType >()
13201320
1321+ // KFunctionX doesn't implement FunctionX on versions before 1.7.0:
1322+ if ((callTarget.name.asString() == " invoke" ) &&
1323+ (receiverClass.fqNameWhenAvailable?.asString()?.startsWith(" kotlin.reflect.KFunction" ) == true ) &&
1324+ (callTarget.parentClassOrNull?.fqNameWhenAvailable?.asString()?.startsWith(" kotlin.Function" ) == true )
1325+ ) {
1326+ return receiverType.arguments
1327+ }
1328+
13211329 // Populate ancestorTypes with the path from receiverType's class to its ancestor, callTarget's declaring type.
13221330 fun walkFrom (c : IrClass ): Boolean {
13231331 if (declaringType == c)
Original file line number Diff line number Diff line change 1- | app/src/main/kotlin/testProject/App.kt:0:0:0:0 | Failed to find a class declaring invoke starting at KFunction2 |
You can’t perform that action at this time.
0 commit comments