Skip to content

Commit 8859b24

Browse files
committed
GROOVY-9982
1 parent b454948 commit 8859b24

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

  • base-test/org.eclipse.jdt.groovy.core.tests.compiler/src/org/eclipse/jdt/groovy/core/tests/basic

base-test/org.eclipse.jdt.groovy.core.tests.compiler/src/org/eclipse/jdt/groovy/core/tests/basic/GroovySimpleTests.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4371,6 +4371,28 @@ public void testReferencingFields_DirectAccess9() {
43714371
runNegativeTest(sources, "");
43724372
}
43734373

4374+
@Test // GROOVY-9982
4375+
public void testReferencingFields_ThisClassPropertyVsSuperClassMethod() {
4376+
//@formatter:off
4377+
String[] sources = {
4378+
"Script.groovy",
4379+
"abstract class A {\n" +
4380+
" def foo() { 'foo' }\n" +
4381+
"}\n" +
4382+
"class C extends A {\n" +
4383+
" def foo\n" +
4384+
" def test() {\n" +
4385+
" foo = foo()\n" + // not ScriptBytecodeAdapter#invokeClosure
4386+
" foo\n" +
4387+
" }\n" +
4388+
"}\n" +
4389+
"print new C().test()\n",
4390+
};
4391+
//@formatter:on
4392+
4393+
runConformTest(sources, "foo");
4394+
}
4395+
43744396
@Test
43754397
public void testGroovyObjectsAreGroovyAtCompileTime() {
43764398
//@formatter:off

0 commit comments

Comments
 (0)