Skip to content

Commit 4b5651b

Browse files
committed
Add test for Java extracting ErrorType
1 parent c0f8973 commit 4b5651b

File tree

6 files changed

+30
-0
lines changed

6 files changed

+30
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
| Test.java:7:12:7:14 | nsc |
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import java
2+
3+
select any(Expr e | e.getType() instanceof ErrorType)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Test.java:
2+
# 6| [TypeAccess] NoSuchClass
3+
# 0| [CompilationUnit] Test
4+
#-----| -1: (Imports)
5+
# 1| 1: [ImportType] import NoSuchClass
6+
# 3| 1: [Class] Test
7+
# 5| 2: [Method] test
8+
# 5| 3: [TypeAccess] NoSuchClass
9+
# 5| 5: [BlockStmt] { ... }
10+
# 6| 0: [LocalVariableDeclStmt] var ...;
11+
# 6| 0: [TypeAccess] NoSuchClass
12+
# 6| 1: [LocalVariableDeclExpr] nsc
13+
# 7| 1: [ReturnStmt] return ...
14+
# 7| 0: [VarAccess] nsc
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
semmle/code/java/PrintAst.ql
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import nosuchpackage.NoSuchClass;
2+
3+
public class Test {
4+
5+
public NoSuchClass test() {
6+
NoSuchClass nsc = new NoSuchClass();
7+
return nsc;
8+
}
9+
10+
}
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)