mirror of
https://github.com/github/codeql.git
synced 2025-12-18 01:33:15 +01:00
Kotlin: Don't warn if we can't find a label for a fake owner
The fake owner probably just wasn't extracted
This commit is contained in:
@@ -205,7 +205,7 @@ open class KotlinFileExtractor(
|
||||
}
|
||||
|
||||
@OptIn(ObsoleteDescriptorBasedAPI::class)
|
||||
private fun isFake(d: IrDeclarationWithVisibility): Boolean {
|
||||
fun isFake(d: IrDeclarationWithVisibility): Boolean {
|
||||
val hasFakeVisibility =
|
||||
d.visibility.let {
|
||||
it is DelegatedDescriptorVisibility && it.delegate == Visibilities.InvisibleFake
|
||||
|
||||
@@ -41,7 +41,13 @@ open class CommentExtractor(
|
||||
tw.getExistingLabelFor<DbTop>(label)
|
||||
}
|
||||
if (existingLabel == null) {
|
||||
logger.warn("Couldn't get existing label for $label")
|
||||
// Sometimes we don't extract elements.
|
||||
// The actual extractor logic is a bit more nuanced than
|
||||
// just "isFake", but just checking isFake is good enough
|
||||
// to not bother with a warning.
|
||||
if(element !is IrDeclarationWithVisibility || !fileExtractor.isFake(element)) {
|
||||
logger.warn("Couldn't get existing label for $label")
|
||||
}
|
||||
return null
|
||||
}
|
||||
return existingLabel
|
||||
|
||||
Reference in New Issue
Block a user