You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (JIRA)" <ji...@apache.org> on 2017/01/25 11:22:26 UTC
[jira] [Comment Edited] (GROOVY-5318) generic types in
fully-qualified class names parsing error
[ https://issues.apache.org/jira/browse/GROOVY-5318?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15837586#comment-15837586 ]
Paul King edited comment on GROOVY-5318 at 1/25/17 11:21 AM:
-------------------------------------------------------------
@daniel_sun I added a PR to put in an extra check in AntlrParserPlugin for the error case. It seemed easier than trying to get the antlr2 grammar to handle that case. The current plan is to merge that just into the 2.5.x stream. You won't need that merge into the parrot branch since the grammar catches it earlier. I presume you already have test coverage. Assuming I merge, I'll adjust the fix version.
was (Author: paulk):
@daniel_sun I added a PR to put in an extra check in AntlrParserPlugin for the error case. It seemed easier than trying to get the antlr2 grammar to handle that case. The current plan is to merge that just into the 2.5.x stream. You won't need that merge into the parrot branch since the grammar catches it earlier. I presume you already have test coverage.
> generic types in fully-qualified class names parsing error
> ----------------------------------------------------------
>
> Key: GROOVY-5318
> URL: https://issues.apache.org/jira/browse/GROOVY-5318
> Project: Groovy
> Issue Type: Bug
> Components: parser
> Affects Versions: 1.8.6
> Environment: Groovy 1.8.6 on Java 7
> Reporter: Gavin Grover
> Assignee: Daniel Sun
> Priority: Minor
> Fix For: 3.0
>
>
> The following code compiles and runs in Groovy 1.8.6...
> {code}
> def a= new java.util<Integer>.ArrayList<ArrayList<Integer>>()
> {code}
> The parser allows a generic type after each name in the fully-qualified class name. The generic type should only be after the final name.
> The relevant part of the Antlr parser that needs fixing is:
> {code}
> typeParameters: LT typeParameter (COMMA typeParameter)* (typeArgumentsOrParametersEnd)?
> typeParameter: IDENT (typeParameterBounds)?
> typeParameterBounds: "extends" classOrInterfaceType (BAND! classOrInterfaceType)*
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)