[ https://issues.apache.org/jira/browse/GROOVY-7972?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15580232#comment-15580232 ]
Shil Sinha commented on GROOVY-7972: ------------------------------------ This isn't exclusive to maps; lines ending with '>>' as part of a parameterized type result in errors parsing the following line. Example: {code} def test() { def l = [[1]] as List<List<Integer>> l } {code} The code above results in the following error: {code} expecting '}', found 'l' at line: 3, column: 5 {code} > Strange compilation error with an "as" cast and a nested generics map > --------------------------------------------------------------------- > > Key: GROOVY-7972 > URL: https://issues.apache.org/jira/browse/GROOVY-7972 > Project: Groovy > Issue Type: Bug > Components: parser > Affects Versions: 1.8.6, 2.4.7 > Environment: * > Reporter: Maik Igloffstein > > {code:title=Bad Groovy} > def myMap = [:] as Map<String, Map<String,String>> > def foo = '' > {code} > tells: > {code:title=Error} > 1 compilation error: > expecting EOF, found 'def' at line: 2, column: 1 > {code} > but: > {code:title=Good Groovy} > def myMap = [:] as Map<String, Map<String,String> > > def bar = '' > {code} > works fine. > Difference lies between _>>_ and _> >_ (with space). > Fix "Bad Groovy" assignment. -- This message was sent by Atlassian JIRA (v6.3.4#6332)