You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2021/06/09 15:12:00 UTC
[jira] [Comment Edited] (GROOVY-5609) Type checking of generic
argument types of extension methods on abstract classes using generics
[ https://issues.apache.org/jira/browse/GROOVY-5609?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17360142#comment-17360142 ]
Eric Milles edited comment on GROOVY-5609 at 6/9/21, 3:11 PM:
--------------------------------------------------------------
Appears to be working properly in Groovy 2.5:
!image-2021-06-09-10-11-28-435.png!
was (Author: emilles):
Appears to be working properly in Groovy 2.5:
!image-2021-06-09-10-10-45-810.png!
> Type checking of generic argument types of extension methods on abstract classes using generics
> -----------------------------------------------------------------------------------------------
>
> Key: GROOVY-5609
> URL: https://issues.apache.org/jira/browse/GROOVY-5609
> Project: Groovy
> Issue Type: Bug
> Components: Static Type Checker
> Affects Versions: 2.0.1
> Reporter: Cédric Champeau
> Priority: Minor
> Attachments: image-2021-06-09-10-11-28-435.png
>
>
> If an extension method is using an abstract class or an array as the first argument and that argument makes use of a generic type defined in the signature of the extension method, the type checker won't be able to type check a method call properly.
> Example:
> {code}
> // <T> is used in the first argument
> public static <T> void foo(AbstractList<T> list, T[] elems)
> // <T> is used in an array of the first argument
> public static <T> void foo(T[] list, T[] elems)
> {code}
> Note that the limitation doesn't exist if the method is defined on an interface.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)