Skip to content

Commit

Permalink
GROOVY-9905
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-milles committed Jan 23, 2021
1 parent 3d3fa51 commit 1b4760f
Show file tree
Hide file tree
Showing 5 changed files with 780 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2009-2020 the original author or authors.
* Copyright 2009-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -2022,4 +2022,31 @@ public void testAccessOuterClassMemberFromInnerClassMethod4() {

runConformTest(sources, "value");
}

@Test // // https://issues.apache.org/jira/browse/GROOVY-9905
public void testAccessOuterClassMemberFromInnerClassMethod5() {
//@formatter:off
String[] sources = {
"Script.groovy",
"abstract class A {\n" +
" protected final f = 'x'\n" +
" abstract static class B {}\n" +
"}\n" +
"class C extends A {\n" +
" private class D extends A.B {\n" + // B is static inner
" String toString() {\n" +
" println(f)\n" + // No such property: f for class: A
" return 'y'\n" +
" }\n" +
" }\n" +
" def m() {\n" +
" new D().toString()\n" +
" }\n" +
"}\n" +
"new C().m()\n",
};
//@formatter:on

runConformTest(sources, "x");
}
}
2 changes: 1 addition & 1 deletion base/org.codehaus.groovy30/.checkstyle
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<file-match-pattern match-pattern="groovy/classgen/AsmClassGenerator.java" include-pattern="false" />
<file-match-pattern match-pattern="groovy/classgen/EnumVisitor.java" include-pattern="false" />
<file-match-pattern match-pattern="groovy/classgen/ExtendedVerifier.java" include-pattern="false" />
<file-match-pattern match-pattern="groovy/classgen/InnerClassVisitorHelper.java" include-pattern="false" />
<file-match-pattern match-pattern="groovy/classgen/InnerClass(CompletionVisitor|VisitorHelper).java" include-pattern="false" />
<file-match-pattern match-pattern="groovy/classgen/ReturnAdder.java" include-pattern="false" />
<file-match-pattern match-pattern="groovy/classgen/Verifier.java" include-pattern="false" />
<file-match-pattern match-pattern="groovy/classgen/asm/CallSiteWriter.java" include-pattern="false" />
Expand Down
Loading

0 comments on commit 1b4760f

Please sign in to comment.