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
22
33import org.jetbrains.kotlin.name.FqName
44import org.jetbrains.kotlin.ir.declarations.IrDeclaration
5+ import org.jetbrains.kotlin.ir.declarations.IrField
56import org.jetbrains.kotlin.ir.declarations.IrMemberWithContainerSource
67import org.jetbrains.kotlin.load.kotlin.FacadeClassSource
78
89fun getFileClassFqName (d : IrDeclaration ): FqName ? {
910 // d is in a file class.
1011 // Get the name in a similar way to the compiler's ExternalPackageParentPatcherLowering
1112 // 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
1224 if (d is IrMemberWithContainerSource ) {
1325 val containerSource = d.containerSource
1426 if (containerSource is FacadeClassSource ) {
You can’t perform that action at this time.
0 commit comments