Skip to content

Commit

Permalink
also verify error position for ANONYMOUS_CLASS_MISSING_MEMBERS
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenzoBettini committed Dec 29, 2023
1 parent 5d39e36 commit c2789f6
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -959,8 +959,11 @@ public void testClassMustBeAbstract_06() throws Exception {
}

@Test public void testAnonymousClassMustBeAbstract() throws Exception {
XtendClass xtendClass = clazz("class Foo { val foo = new Runnable() {} }");
helper.assertError(xtendClass, ANONYMOUS_CLASS, ANONYMOUS_CLASS_MISSING_MEMBERS, "The anonymous subclass of Runnable does not implement run()");
var source = "class Foo { val foo = new Runnable() {} }";
XtendClass xtendClass = clazz(source);
helper.assertError(xtendClass, ANONYMOUS_CLASS, ANONYMOUS_CLASS_MISSING_MEMBERS,
source.indexOf("new Runnable()"), "new Runnable()".length(),
"The anonymous subclass of Runnable does not implement run()");
}

@Test public void testAnonymousClassIncompatibleSignature_0() throws Exception {
Expand Down

0 comments on commit c2789f6

Please sign in to comment.