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/05/02 02:03:06 UTC
[jira] [Closed] (GROOVY-6659) generic bounds ignored by type
checking
[ https://issues.apache.org/jira/browse/GROOVY-6659?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul King closed GROOVY-6659.
-----------------------------
> generic bounds ignored by type checking
> ---------------------------------------
>
> Key: GROOVY-6659
> URL: https://issues.apache.org/jira/browse/GROOVY-6659
> Project: Groovy
> Issue Type: Bug
> Components: Static compilation, Static Type Checker
> Affects Versions: 2.3.0, 2.2.3, 2.4.0-beta-3
> Reporter: Jochen Theodorou
> Fix For: 2.5.0-alpha-1
>
>
> {code:Java}
> class A{}
> class B{}
> @groovy.transform.CompileStatic
> class Helper<V extends A> {
> public Helper(Closure<V> cl) {}
> }
> @groovy.transform.CompileStatic
> static <C extends B> void extensionMethod(Closure<C> cl) {
> new Helper<C>(cl)
> }
> {code}
> The example is inspired by the fix done for GROOVY-6657, not sure versions before are affected, since this kind of code failed before. So it might be seen as regression.
> Anyway, the code above should not compile, since Helper cannot extend A and B at the same time.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)