groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul King (JIRA)" <>
Subject [jira] [Commented] (GROOVY-8837) Invalid type inference for redefined generic boundaries
Date Tue, 09 Oct 2018 23:44:00 GMT


Paul King commented on GROOVY-8837:

Generics is definitely an area which needs more work but I was unable to reproduce with your
example. But perhaps I changed something important. To get your example to work I moved the
Groovy test file to {{src/test/groovy}} and I changed the Groovy dependency to be {{groovy}}
and {{groovy-test}} instead of {{groovy-all}} (just in dependencies not under plugins). After
those changes I get:
 T E S T S
Running sample.SubClassTest
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.188 sec

Results :

Tests run: 3, Failures: 0, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------

> Invalid type inference for redefined generic boundaries
> -------------------------------------------------------
>                 Key: GROOVY-8837
>                 URL:
>             Project: Groovy
>          Issue Type: Bug
>          Components: Compiler
>    Affects Versions: 2.5.2
>            Reporter: Constantine Plotnikov
>            Priority: Major
>         Attachments:
> Static compiler incorrectly calculates type boundary for chain calls with generic types.
When method is called, it takes boundary defined in the method of the class (Base in sample),
instead of the boundary redefined in subclass (SubClass in sample).
> The bug was discovered when working with Lombok SuperBuilder generated classes from Groovy.
The attached project demonstrate the bug on the smaller sample.
> Note that Java test infers type correctly, but groovy does not. However, the groovy test
works when CompileStatic annotation is disabled.
> IDEA also shows red code here, but it possibly follows Groovy logic.
> The bug also affects earlier versions.

This message was sent by Atlassian JIRA

View raw message