mirror of
https://github.com/github/codeql.git
synced 2025-12-23 04:06:37 +01:00
Extract type parameters without substituting their parent functions
Otherwise references to type variables declared on kotlin.Xyz.someFunction can refer to its Java equivalent java.Xyz.someFunction if it has one.
This commit is contained in:
@@ -173,19 +173,7 @@ open class KotlinFileExtractor(
|
||||
|
||||
fun extractTypeParameter(tp: IrTypeParameter, apparentIndex: Int): Label<out DbTypevariable>? {
|
||||
with("type parameter", tp) {
|
||||
val parentId: Label<out DbClassorinterfaceorcallable>? = when (val parent = tp.parent) {
|
||||
is IrFunction -> useFunction(parent)
|
||||
is IrClass -> useClassSource(parent)
|
||||
else -> {
|
||||
logger.errorElement("Unexpected type parameter parent", tp)
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
if (parentId == null) {
|
||||
return null
|
||||
}
|
||||
|
||||
val parentId = getTypeParameterParentLabel(tp) ?: return null
|
||||
val id = tw.getLabelFor<DbTypevariable>(getTypeParameterLabel(tp))
|
||||
|
||||
// Note apparentIndex does not necessarily equal `tp.index`, because at least constructor type parameters
|
||||
|
||||
Reference in New Issue
Block a user