Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8d6ae50

Browse files
smowtonigfoo
authored andcommitted
Don't try to assign comments to fake overrides
1 parent 613e6b2 commit 8d6ae50

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

java/kotlin-extractor/src/main/kotlin/utils/IrVisitorLookup.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ package com.github.codeql.utils
33
import com.github.codeql.utils.versions.Psi2Ir
44
import com.intellij.psi.PsiElement
55
import org.jetbrains.kotlin.ir.IrElement
6+
import org.jetbrains.kotlin.ir.declarations.IrDeclaration
67
import org.jetbrains.kotlin.ir.declarations.IrFile
8+
import org.jetbrains.kotlin.ir.util.isFakeOverride
79
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
810

911
class IrVisitorLookup(private val psi: PsiElement, private val file: IrFile) :
@@ -18,6 +20,12 @@ class IrVisitorLookup(private val psi: PsiElement, private val file: IrFile) :
1820
return
1921
}
2022

23+
if (element is IrDeclaration && element.isFakeOverride) {
24+
// These aren't extracted, so we don't expect anything to exist
25+
// to which we could ascribe a comment.
26+
return
27+
}
28+
2129
if (location.contains(elementLocation)) {
2230
val psiElement = Psi2Ir().findPsiElement(element, file)
2331
if (psiElement == psi) {

0 commit comments

Comments
 (0)