Skip to content

Commit 6236642

Browse files
Merge pull request #219 from lisa-analyzer/throw-exception-anon-classes
Throw exception if anonymous class detected
2 parents ad66cda + f2ac2e0 commit 6236642

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

jlisa/src/main/java/it/unive/jlisa/frontend/visitors/ExpressionVisitor.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,12 @@ public boolean visit(
347347
@Override
348348
public boolean visit(
349349
ClassInstanceCreation node) {
350+
if (node.getAnonymousClassDeclaration() != null) {
351+
throw new ParsingException("anonymous-class",
352+
ParsingException.Type.UNSUPPORTED_STATEMENT,
353+
"Anonymous classes are not supported.",
354+
getSourceCodeLocation(node));
355+
}
350356
TypeASTVisitor typeVisitor = new TypeASTVisitor(parserContext, source, compilationUnit, container);
351357
node.getType().accept(typeVisitor);
352358
Type type = typeVisitor.getType();

jlisa/src/test/java/it/unive/jlisa/svcomp/SVCompTestcases.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ public void urldecoder2_test() throws IOException {
332332
perform(conf);
333333
}
334334

335-
@Test
335+
@Ignore // Ignored due to anonymous class.
336336
public void Basic1_test() throws IOException {
337337
// this test had troublesome parsing errors,
338338
// but it is too complex to thoroughly check its results

0 commit comments

Comments
 (0)