Skip to content

Commit

Permalink
also verify error position for anonymous class override final class
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenzoBettini committed Dec 29, 2023
1 parent c2789f6 commit e424b1a
Showing 1 changed file with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2367,16 +2367,19 @@ public void testWildcardSuperType_5() throws Exception {

@Test
public void testAnonymousClassExtendsFinal() throws Exception {
XtendFile file = file(
"class Foo {"
+ " val bar = new Bar() {"
+ " }"
+ "}"
+ "final class Bar {"
+ "}");
helper.assertError(file.getXtendTypes().get(0), XCONSTRUCTOR_CALL, OVERRIDDEN_FINAL);
var source = "class Foo {"
+ " val bar = new Bar() {"
+ " }"
+ "}"
+ "final class Bar {"
+ "}";
XtendFile file = file(source);
helper.assertError(file.getXtendTypes().get(0),
XCONSTRUCTOR_CALL, OVERRIDDEN_FINAL,
source.indexOf("Bar"), "Bar".length(),
"Attempt to override final class");
}

@Test
public void testVoidInFunctionParams() throws Exception {
XtendFile file = file(
Expand Down

0 comments on commit e424b1a

Please sign in to comment.