mirror of
https://github.com/github/codeql.git
synced 2025-12-22 19:56:32 +01:00
Merge pull request #10268 from tamasvajk/kotlin-local-function-comments
Kotlin: fix doc comment extraction for local functions
This commit is contained in:
@@ -1140,10 +1140,6 @@ open class KotlinUsesExtractor(
|
||||
// Note not using `parentsWithSelf` as that only works if `d` is an IrDeclarationParent
|
||||
d.parents.any { (it as? IrAnnotationContainer)?.hasAnnotation(jvmWildcardSuppressionAnnotaton) == true }
|
||||
|
||||
protected fun IrFunction.isLocalFunction(): Boolean {
|
||||
return this.visibility == DescriptorVisibilities.LOCAL
|
||||
}
|
||||
|
||||
/**
|
||||
* Class to hold labels for generated classes around local functions, lambdas, function references, and property references.
|
||||
*/
|
||||
@@ -1185,6 +1181,14 @@ open class KotlinUsesExtractor(
|
||||
return res
|
||||
}
|
||||
|
||||
fun getExistingLocallyVisibleFunctionLabel(f: IrFunction): Label<DbMethod>? {
|
||||
if (!f.isLocalFunction()){
|
||||
return null
|
||||
}
|
||||
|
||||
return tw.lm.locallyVisibleFunctionLabelMapping[f]?.function
|
||||
}
|
||||
|
||||
// These are classes with Java equivalents, but whose methods don't all exist on those Java equivalents--
|
||||
// for example, the numeric classes define arithmetic functions (Int.plus, Long.or and so on) that lower to
|
||||
// primitive arithmetic on the JVM, but which we extract as calls to reflect the source syntax more closely.
|
||||
|
||||
Reference in New Issue
Block a user