Skip to content

Commit 9670f20

Browse files
committed
Add test for method reference whose LHS has unknown type
This can happen when imports or source classes are missing.
1 parent 6ea7b19 commit 9670f20

File tree

4 files changed

+14
-0
lines changed

4 files changed

+14
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
| Test.java:0:0:0:0 | 1 |
2+
| Test.java:4:13:4:30 | Unable to extract method reference Unavailable.f()::g with no owner type |
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import java
2+
import semmle.code.java.Diagnostics
3+
4+
select any(Diagnostic d | not d.toString().matches("Not rewriting trap file for%"))
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
public class Test {
2+
3+
public static void test() {
4+
var x = Unavailable.f()::g;
5+
}
6+
7+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
//semmle-extractor-options: --no-strict-javac-errors --javac-args -source 17 -target 17

0 commit comments

Comments
 (0)