Skip to content

Commit 9ad1b29

Browse files
committed
Fix the test groovy.bugs.Groovy5318Bug.testTypeArgumentsOnlyOnTheLastComponent
1 parent 5c63ad6 commit 9ad1b29

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/test/groovy/bugs/Groovy5318Bug.groovy

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,18 @@
1919
package groovy.bugs
2020

2121
import gls.CompilableTestSupport
22+
import org.codehaus.groovy.control.CompilerConfiguration
2223

2324
class Groovy5318Bug extends CompilableTestSupport {
2425
void testTypeArgumentsOnlyOnTheLastComponent() {
2526
def message = shouldNotCompile """
2627
def a = new java.util<Integer>.ArrayList<ArrayList<Integer>>()
2728
"""
28-
assert message.contains('Unexpected type arguments found prior to: ArrayList')
29+
30+
if (CompilerConfiguration.DEFAULT.antlr2Parser) {
31+
assert message.contains('Unexpected type arguments found prior to: ArrayList')
32+
} else {
33+
assert message.contains('Unexpected input: \'new java.util<Integer>.\'')
34+
}
2935
}
3036
}

0 commit comments

Comments
 (0)