Skip to content

Commit a1c8e2a

Browse files
committed
GROOVY-10375
1 parent dfe32b0 commit a1c8e2a

File tree

5 files changed

+779
-3
lines changed

5 files changed

+779
-3
lines changed

base-test/org.eclipse.jdt.groovy.core.tests.compiler/src/org/eclipse/jdt/groovy/core/tests/xform/StaticCompilationTests.java

+26-1
Original file line numberDiff line numberDiff line change
@@ -5649,7 +5649,7 @@ public void testCompileStatic9737b() {
56495649
"@groovy.transform.CompileStatic\n" +
56505650
"class C extends p.A {\n" +
56515651
" void test() {\n" +
5652-
" m('')\n" + // VerifyError: Bad access to protected data in invokevirtual
5652+
" m('')\n" + // IncompatibleClassChangeError: Found class but interface was expected
56535653
" }\n" +
56545654
"}\n" +
56555655
"new C().test()\n",
@@ -6597,4 +6597,29 @@ public void testCompileStatic10319() {
65976597

65986598
runConformTest(sources, "p.C([1])");
65996599
}
6600+
6601+
@Test
6602+
public void testCompileStatic10375() {
6603+
assumeTrue(isParrotParser());
6604+
6605+
//@formatter:off
6606+
String[] sources = {
6607+
"Main.groovy",
6608+
"import java.util.function.Supplier\n" +
6609+
"@groovy.transform.CompileStatic\n" +
6610+
"class C {\n" +
6611+
" private String getX() {\n" +
6612+
" return 'works'\n" +
6613+
" }\n" +
6614+
" void test() {\n" +
6615+
" Supplier<String> s = () -> x\n" + // GroovyCastException
6616+
" print s.get()\n" +
6617+
" }\n" +
6618+
"}\n" +
6619+
"new C().test()\n",
6620+
};
6621+
//@formatter:on
6622+
6623+
runConformTest(sources, "works");
6624+
}
66006625
}

base/org.codehaus.groovy30/.checkstyle

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
<file-match-pattern match-pattern="groovy/classgen/asm/StatementWriter.java" include-pattern="false" />
4848
<file-match-pattern match-pattern="groovy/classgen/asm/sc/StaticInvocationWriter.java" include-pattern="false" />
4949
<file-match-pattern match-pattern="groovy/classgen/asm/sc/StaticPropertyAccessHelper.java" include-pattern="false" />
50-
<file-match-pattern match-pattern="groovy/classgen/asm/sc/StaticTypes(CallSite|Closure|MethodReferenceExpression)Writer.java" include-pattern="false" />
50+
<file-match-pattern match-pattern="groovy/classgen/asm/sc/StaticTypes(CallSite|Closure|Lambda|MethodReferenceExpression)Writer.java" include-pattern="false" />
5151
<file-match-pattern match-pattern="groovy/control/CompilationUnit.java" include-pattern="false" />
5252
<file-match-pattern match-pattern="groovy/control/CompilerConfiguration.java" include-pattern="false" />
5353
<file-match-pattern match-pattern="groovy/control/ErrorCollector.java" include-pattern="false" />

0 commit comments

Comments
 (0)