Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.1.0-rc-1
-
None
-
None
Description
If I do this:
@groovy.transform.CompileStatic class Element { String name static Iterator<Element> single() { [ new Element( name: 'single' ) ].iterator() } static Iterator<List<Element>> multi() { [ [ new Element( name: 'first' ), new Element( name: 'second' ) ] ].iterator() } static caller( boolean useSingle ) { useSingle ? single() : multi() } } println Element.caller( false ).collect() println Element.caller( true ).collect()
I get:
java.lang.StackOverflowError at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.fullyResolveType(StaticTypeCheckingVisitor.java:2936) at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.fullyResolve(StaticTypeCheckingVisitor.java:2912) at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.fullyResolveType(StaticTypeCheckingVisitor.java:2936) at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.fullyResolve(StaticTypeCheckingVisitor.java:2912) at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.fullyResolveType(StaticTypeCheckingVisitor.java:2936) at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.fullyResolve(StaticTypeCheckingVisitor.java:2912) at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.fullyResolveType(StaticTypeCheckingVisitor.java:2936) ...