Skip to content

Commit c5f400f

Browse files
committed
GROOVY-10557
1 parent 301dacc commit c5f400f

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

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

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7343,4 +7343,27 @@ public void testCompileStatic10476() {
73437343

73447344
runConformTest(sources, "[FOO, BAR, BAZ]");
73457345
}
7346+
7347+
@Test
7348+
public void testCompileStatic10557() {
7349+
//@formatter:off
7350+
String[] sources = {
7351+
"Main.groovy",
7352+
"class C {\n" +
7353+
" def <T> T m(java.util.function.Function<Reader,T> f) {\n" +
7354+
" new StringReader('').withCloseable { reader ->\n" +
7355+
" f.apply(reader)\n" +
7356+
" }\n" +
7357+
" }\n" +
7358+
"}\n" +
7359+
"@groovy.transform.CompileStatic\n" +
7360+
"void test() {\n" +
7361+
" print(new C().m { it.text.empty })\n" +
7362+
"}\n" +
7363+
"test()\n",
7364+
};
7365+
//@formatter:on
7366+
7367+
runConformTest(sources, "true");
7368+
}
73467369
}

0 commit comments

Comments
 (0)