Skip to content

Commit 4f256d2

Browse files
tamasvajkigfoo
authored andcommitted
Change LambdaExpr::asMethod to return the big-arity invoke instead of the wrapper
1 parent af3bc4f commit 4f256d2

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

java/ql/lib/semmle/code/java/Expr.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1379,7 +1379,7 @@ class LambdaExpr extends FunctionalExpr, @lambdaexpr {
13791379
or
13801380
isKotlinFunctionN() and
13811381
result = this.getAnonymousClass().getAMethod() and
1382-
result.getNumberOfParameters() = 1
1382+
result.getNumberOfParameters() > 1
13831383
}
13841384

13851385
/**

java/ql/test/kotlin/library-tests/exprs/funcExprs.expected

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ lambdaExpr
1313
| funcExprs.kt:33:28:33:51 | ...->... | stmt body | funcExprs.kt:33:28:33:51 | invoke | invoke(int) | funcExprs.kt:33:28:33:51 | new Function1<Integer,Function1<Integer,Double>>(...) { ... } |
1414
| funcExprs.kt:33:37:33:47 | ...->... | stmt body | funcExprs.kt:33:37:33:47 | invoke | invoke(int) | funcExprs.kt:33:37:33:47 | new Function1<Integer,Double>(...) { ... } |
1515
| funcExprs.kt:35:29:35:112 | ...->... | stmt body | funcExprs.kt:35:29:35:112 | invoke | invoke(int,int,int,int,int,int,int,int,int,int,int,int,int,int,int,int,int,int,int,int,int,int) | funcExprs.kt:35:29:35:112 | new Function22<Integer,Integer,Integer,Integer,Integer,Integer,Integer,Integer,Integer,Integer,Integer,Integer,Integer,Integer,Integer,Integer,Integer,Integer,Integer,Integer,Integer,Integer,Unit>(...) { ... } |
16-
| funcExprs.kt:36:29:36:117 | ...->... | stmt body | funcExprs.kt:36:29:36:117 | invoke | invoke(java.lang.Object[]) | funcExprs.kt:36:29:36:117 | new FunctionN<String>(...) { ... } |
16+
| funcExprs.kt:36:29:36:117 | ...->... | stmt body | funcExprs.kt:36:29:36:117 | invoke | invoke(int,int,int,int,int,int,int,int,int,int,int,int,int,int,int,int,int,int,int,int,int,int,int) | funcExprs.kt:36:29:36:117 | new FunctionN<String>(...) { ... } |
1717
| funcExprs.kt:75:12:75:22 | ...->... | stmt body | funcExprs.kt:75:12:75:22 | invoke | invoke(Class3.Generic) | funcExprs.kt:75:12:75:22 | new Function1<Generic<Generic<Integer>>,String>(...) { ... } |
1818
| samConversion.kt:2:31:2:45 | ...->... | stmt body | samConversion.kt:2:31:2:45 | invoke | invoke(int) | samConversion.kt:2:31:2:45 | new Function1<Integer,Boolean>(...) { ... } |
1919
| samConversion.kt:4:27:4:42 | ...->... | stmt body | samConversion.kt:4:27:4:42 | invoke | invoke(int,int) | samConversion.kt:4:27:4:42 | new Function2<Integer,Integer,Unit>(...) { ... } |
2020
| samConversion.kt:7:29:7:46 | ...->... | stmt body | samConversion.kt:7:29:7:46 | invoke | invoke(java.lang.String,int) | samConversion.kt:7:29:7:46 | new Function2<String,Integer,Boolean>(...) { ... } |
2121
| samConversion.kt:9:33:11:5 | ...->... | stmt body | samConversion.kt:9:33:11:5 | invoke | invoke(int) | samConversion.kt:9:33:11:5 | new Function1<Integer,Boolean>(...) { ... } |
2222
| samConversion.kt:11:12:13:5 | ...->... | stmt body | samConversion.kt:11:12:13:5 | invoke | invoke(int) | samConversion.kt:11:12:13:5 | new Function1<Integer,Boolean>(...) { ... } |
23-
| samConversion.kt:43:31:45:68 | ...->... | stmt body | samConversion.kt:43:31:45:68 | invoke | invoke(java.lang.Object[]) | samConversion.kt:43:31:45:68 | new FunctionN<Boolean>(...) { ... } |
23+
| samConversion.kt:43:31:45:68 | ...->... | stmt body | samConversion.kt:43:31:45:68 | invoke | invoke(int,int,int,int,int,int,int,int,int,int,int,int,int,int,int,int,int,int,int,int,int,int,int) | samConversion.kt:43:31:45:68 | new FunctionN<Boolean>(...) { ... } |
2424
| samConversion.kt:46:32:46:44 | ...->... | stmt body | samConversion.kt:46:32:46:44 | invoke | invoke(int) | samConversion.kt:46:32:46:44 | new Function1<Integer,Boolean>(...) { ... } |
2525
memberRefExprs
2626
| funcExprs.kt:38:26:38:38 | ...::... | funcExprs.kt:38:26:38:38 | invoke | invoke() | funcExprs.kt:38:26:38:38 | new Function0<Integer>(...) { ... } |

0 commit comments

Comments
 (0)