File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
java/kotlin-extractor/src/main/kotlin/utils/versions/v_1_7_0 Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -2,13 +2,25 @@ package com.github.codeql.utils.versions
2
2
3
3
import org.jetbrains.kotlin.name.FqName
4
4
import org.jetbrains.kotlin.ir.declarations.IrDeclaration
5
+ import org.jetbrains.kotlin.ir.declarations.IrField
5
6
import org.jetbrains.kotlin.ir.declarations.IrMemberWithContainerSource
6
7
import org.jetbrains.kotlin.load.kotlin.FacadeClassSource
7
8
8
9
fun getFileClassFqName (d : IrDeclaration ): FqName ? {
9
10
// d is in a file class.
10
11
// Get the name in a similar way to the compiler's ExternalPackageParentPatcherLowering
11
12
// visitMemberAccess/generateOrGetFacadeClass.
13
+
14
+ // But first, fields aren't IrMemberWithContainerSource, so we need
15
+ // to get back to the property (if there is one)
16
+ if (d is IrField ) {
17
+ val propSym = d.correspondingPropertySymbol
18
+ if (propSym != null ) {
19
+ return getFileClassFqName(propSym.owner)
20
+ }
21
+ }
22
+
23
+ // Now the main code
12
24
if (d is IrMemberWithContainerSource ) {
13
25
val containerSource = d.containerSource
14
26
if (containerSource is FacadeClassSource ) {
You can’t perform that action at this time.
0 commit comments