mirror of
https://github.com/github/codeql.git
synced 2025-12-19 18:33:16 +01:00
Kotlin: Remove cast from extractRawMethodAccess
I'm not entirely happy with this, but it at least meets the goal of removing the cast.
This commit is contained in:
@@ -1427,12 +1427,14 @@ open class KotlinFileExtractor(
|
||||
// type arguments at index -2, -3, ...
|
||||
extractTypeArguments(typeArguments, locId, id, enclosingCallable, enclosingStmt, -2, true)
|
||||
|
||||
val isFunctionInvoke =
|
||||
drType is IrSimpleType
|
||||
&& drType.isFunctionOrKFunction()
|
||||
&& callTarget.name.asString() == OperatorNameConventions.INVOKE.asString()
|
||||
val isBigArityFunctionInvoke = isFunctionInvoke
|
||||
&& (drType as IrSimpleType).arguments.size > BuiltInFunctionArity.BIG_ARITY
|
||||
val (isFunctionInvoke, isBigArityFunctionInvoke) =
|
||||
if (drType is IrSimpleType &&
|
||||
drType.isFunctionOrKFunction() &&
|
||||
callTarget.name.asString() == OperatorNameConventions.INVOKE.asString()) {
|
||||
Pair(true, drType.arguments.size > BuiltInFunctionArity.BIG_ARITY)
|
||||
} else {
|
||||
Pair(false, false)
|
||||
}
|
||||
|
||||
if (callTarget.isLocalFunction()) {
|
||||
val ids = getLocallyVisibleFunctionLabels(callTarget)
|
||||
|
||||
Reference in New Issue
Block a user