mirror of
https://github.com/github/codeql.git
synced 2026-05-04 05:05:12 +02:00
Merge pull request #9120 from igfoo/igfoo/fixes
Kotlin: Fix some alerts
This commit is contained in:
@@ -1374,10 +1374,10 @@ class LambdaExpr extends FunctionalExpr, @lambdaexpr {
|
||||
* The parameters of the lambda expression are the parameters of this method.
|
||||
*/
|
||||
override Method asMethod() {
|
||||
not isKotlinFunctionN() and
|
||||
not this.isKotlinFunctionN() and
|
||||
result = this.getAnonymousClass().getAMethod()
|
||||
or
|
||||
isKotlinFunctionN() and
|
||||
this.isKotlinFunctionN() and
|
||||
result = this.getAnonymousClass().getAMethod() and
|
||||
result.getNumberOfParameters() > 1
|
||||
}
|
||||
@@ -1644,7 +1644,7 @@ class NotInstanceOfExpr extends Expr, @notinstanceofexpr {
|
||||
Expr getTypeName() { result.isNthChildOf(this, 1) }
|
||||
|
||||
/** Gets the type this `!is` expression checks for. */
|
||||
RefType getCheckedType() { result = getTypeName().getType() }
|
||||
RefType getCheckedType() { result = this.getTypeName().getType() }
|
||||
|
||||
/** Gets a printable representation of this expression. */
|
||||
override string toString() { result = "... !is ..." }
|
||||
|
||||
@@ -91,7 +91,7 @@ class Parameter extends Element, @param, LocalScopeVariable {
|
||||
|
||||
/** Holds if this formal parameter is a parameter representing the dispatch receiver in an extension method. */
|
||||
predicate isExtensionParameter() {
|
||||
getPosition() = 0 and this.getCallable() instanceof ExtensionMethod
|
||||
this.getPosition() = 0 and this.getCallable() instanceof ExtensionMethod
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user