Merge pull request #9120 from igfoo/igfoo/fixes

Kotlin: Fix some alerts
This commit is contained in:
Anders Schack-Mulligen
2022-05-12 08:29:34 +02:00
committed by GitHub
3 changed files with 6 additions and 5 deletions

View File

@@ -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 ..." }

View File

@@ -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
}
/**