mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
Kotlin: Move the isLocalFunction check deeper into useFunction
This commit is contained in:
@@ -1201,15 +1201,14 @@ open class KotlinUsesExtractor(
|
|||||||
} as IrFunction? ?: f
|
} as IrFunction? ?: f
|
||||||
|
|
||||||
fun <T: DbCallable> useFunction(f: IrFunction, classTypeArgsIncludingOuterClasses: List<IrTypeArgument>? = null, noReplace: Boolean = false): Label<out T> {
|
fun <T: DbCallable> useFunction(f: IrFunction, classTypeArgsIncludingOuterClasses: List<IrTypeArgument>? = null, noReplace: Boolean = false): Label<out T> {
|
||||||
if (f.isLocalFunction()) {
|
return useFunction(f, null, classTypeArgsIncludingOuterClasses, noReplace)
|
||||||
val ids = getLocallyVisibleFunctionLabels(f)
|
|
||||||
return ids.function.cast<T>()
|
|
||||||
} else {
|
|
||||||
return useFunction(f, null, classTypeArgsIncludingOuterClasses, noReplace)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun <T: DbCallable> useFunction(f: IrFunction, parentId: Label<out DbElement>?, classTypeArgsIncludingOuterClasses: List<IrTypeArgument>?, noReplace: Boolean = false): Label<out T> {
|
fun <T: DbCallable> useFunction(f: IrFunction, parentId: Label<out DbElement>?, classTypeArgsIncludingOuterClasses: List<IrTypeArgument>?, noReplace: Boolean = false): Label<out T> {
|
||||||
|
if (f.isLocalFunction()) {
|
||||||
|
val ids = getLocallyVisibleFunctionLabels(f)
|
||||||
|
return ids.function.cast<T>()
|
||||||
|
}
|
||||||
val javaFun = kotlinFunctionToJavaEquivalent(f, noReplace)
|
val javaFun = kotlinFunctionToJavaEquivalent(f, noReplace)
|
||||||
val label = getFunctionLabel(javaFun, parentId, classTypeArgsIncludingOuterClasses)
|
val label = getFunctionLabel(javaFun, parentId, classTypeArgsIncludingOuterClasses)
|
||||||
val id: Label<T> = tw.getLabelFor(label)
|
val id: Label<T> = tw.getLabelFor(label)
|
||||||
|
|||||||
Reference in New Issue
Block a user