Skip to content

Commit

Permalink
GROOVY-10557
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-milles committed Mar 30, 2022
1 parent 301dacc commit c5f400f
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7343,4 +7343,27 @@ public void testCompileStatic10476() {

runConformTest(sources, "[FOO, BAR, BAZ]");
}

@Test
public void testCompileStatic10557() {
//@formatter:off
String[] sources = {
"Main.groovy",
"class C {\n" +
" def <T> T m(java.util.function.Function<Reader,T> f) {\n" +
" new StringReader('').withCloseable { reader ->\n" +
" f.apply(reader)\n" +
" }\n" +
" }\n" +
"}\n" +
"@groovy.transform.CompileStatic\n" +
"void test() {\n" +
" print(new C().m { it.text.empty })\n" +
"}\n" +
"test()\n",
};
//@formatter:on

runConformTest(sources, "true");
}
}

0 comments on commit c5f400f

Please sign in to comment.