[ https://issues.apache.org/jira/browse/GROOVY-11711?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18003806#comment-18003806 ]
ASF GitHub Bot commented on GROOVY-11711: ----------------------------------------- eric-milles opened a new pull request, #2260: URL: https://github.com/apache/groovy/pull/2260 (no comment) > Templates not recognized for inner classes in certain scenarios > --------------------------------------------------------------- > > Key: GROOVY-11711 > URL: https://issues.apache.org/jira/browse/GROOVY-11711 > Project: Groovy > Issue Type: Bug > Components: Compiler > Affects Versions: 5.0.0-beta-1 > Reporter: Saravanan > Assignee: Eric Milles > Priority: Minor > > Compiling this code > {code:java} > public class RecordTesting<MyTemplate1> { > static class Blah { > } > class InnerClass implements List<MyTemplate1> { > } > } > {code} > results in this compile error > {code:java} > org.codehaus.groovy.control.MultipleCompilationErrorsException: startup > failed: > testdata/plugins/records/RecordTesting.java: 11: unable to resolve class > MyTemplate1 > @ line 11, column 38. > class InnerClass implements List<MyTemplate1> { > > ^testdata/plugins/records/RecordTesting.java: 11: unable to resolve class > MyTemplate1 > @ line 11, column 38. > class InnerClass implements List<MyTemplate1> { > ^ {code} > If I remove the static in front of class Blah, it will work fine. I narrowed > this down to how the resolvevisitor tracks genericParameterNames. Without the > static, it keeps the outer class generics in this map, but when it sees the > static on class Blah, it clears it out. Now all inner nodes after Blah will > see an error whenever MyTemplate1 is used. Didnt dig deeper -- This message was sent by Atlassian Jira (v8.20.10#820010)