Skip to content

Commit c0a8850

Browse files
committed
GROOVY-9500
1 parent 7bec9d2 commit c0a8850

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

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

+35
Original file line numberDiff line numberDiff line change
@@ -5009,6 +5009,41 @@ public void testCompileStatic9454() {
50095009
runConformTest(sources, "works");
50105010
}
50115011

5012+
@Test
5013+
public void testCompileStatic9500() {
5014+
//@formatter:off
5015+
String[] sources = {
5016+
"Main.groovy",
5017+
"trait Entity<D> {\n" +
5018+
"}\n" +
5019+
"@groovy.transform.CompileStatic @SuppressWarnings('rawtypes')\n" +
5020+
"abstract class Path<F extends Entity, T extends Entity> implements Iterable<Path.Segment<F,T>> {\n" +
5021+
" interface Segment<F, T> {\n" +
5022+
" F start()\n" +
5023+
" T end()\n" +
5024+
" }\n" +
5025+
" abstract F start()\n" +
5026+
" T end\n" +
5027+
" T end() {\n" +
5028+
" end\n" + // Cannot return value of type Path$Segment<F,T> on method returning type T
5029+
" }\n" +
5030+
" @Override\n" +
5031+
" void forEach(java.util.function.Consumer<? super Segment<F, T>> action) {\n" +
5032+
" }\n" +
5033+
" @Override\n" +
5034+
" Spliterator<Segment<F, T>> spliterator() {\n" +
5035+
" }\n" +
5036+
" @Override\n" +
5037+
" Iterator<Segment<F, T>> iterator() {\n" +
5038+
" }\n" +
5039+
"}\n" +
5040+
"null\n",
5041+
};
5042+
//@formatter:on
5043+
5044+
runNegativeTest(sources, "");
5045+
}
5046+
50125047
@Test
50135048
public void testCompileStatic9517() {
50145049
//@formatter:off

0 commit comments

Comments
 (0)