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 2018/08/26 03:09:00 UTC
[jira] [Commented] (GROOVY-4489) Generics compilation error occurs
when using less then (<) operator
[ https://issues.apache.org/jira/browse/GROOVY-4489?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16592760#comment-16592760 ]
Paul King commented on GROOVY-4489:
-----------------------------------
This still happens in 2.5.2 but doesn't happen in the parrot parser.
> Generics compilation error occurs when using less then (<) operator
> -------------------------------------------------------------------
>
> Key: GROOVY-4489
> URL: https://issues.apache.org/jira/browse/GROOVY-4489
> Project: Groovy
> Issue Type: Bug
> Components: Compiler
> Affects Versions: 1.7.4, 1.7.5, 2.4.3, 2.5.2
> Reporter: asandor
> Priority: Major
>
> The following code is throwing a compilation error (the strange code is a DSL):
> {code}
> def FloatComparison() {
> when:
> o.PROPerty1 < o.PROPerty2
>
> then:
> result = true
> }
> Missing closing bracket '>' for generics types;
> solution: Please specify the missing bracket! at line: 5, column: 5
> {code}
> Here are some snippets that don't produce this error:
> {code}
> def FloatComparison() {
> when:
> o.pROPerty1 < o.PROPerty2 //the first letter of the first variable is lowercase
>
> then:
> result = true
> }
> {code}
> {code}
> def FloatComparison() {
> when:
> o.PROPerty1 < o.PROPerty2
>
> //the label is removed and .x is added after result (without .x the exception occurs)
> result.x = true
> }
> {code}
> Looking at the samples that work, this whole mess doesn't make any sense. It seems like a minor but very annoying bug in the compiler. We are working on a DSL, so we can't influence the names of the properties or anything significant that would be a proper workaround.
> (This is technically not a JUnit test case, but I think it's enough because it can be simply copied into the Groovy console and run)
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)