Add test for method reference whose LHS has unknown type

This can happen when imports or source classes are missing.
This commit is contained in:
Chris Smowton
2023-09-13 16:11:10 +01:00
parent 6ea7b195db
commit 9670f20bd7
4 changed files with 14 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
| Test.java:0:0:0:0 | 1 |
| Test.java:4:13:4:30 | Unable to extract method reference Unavailable.f()::g with no owner type |

View File

@@ -0,0 +1,4 @@
import java
import semmle.code.java.Diagnostics
select any(Diagnostic d | not d.toString().matches("Not rewriting trap file for%"))

View File

@@ -0,0 +1,7 @@
public class Test {
public static void test() {
var x = Unavailable.f()::g;
}
}

View File

@@ -0,0 +1 @@
//semmle-extractor-options: --no-strict-javac-errors --javac-args -source 17 -target 17