[
https://issues.apache.org/jira/browse/GROOVY-4489?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17146824#comment-17146824
]
Andres Almiray commented on GROOVY-4489:
----------------------------------------
This no longer fails in 2.5.5 and 3.0.4.
Verified at Hack.Commit.Push 2020
> 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
(v8.3.4#803005)