[
https://issues.apache.org/jira/browse/GROOVY-5839?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15068462#comment-15068462
]
Pascal Schumacher commented on GROOVY-5839:
-------------------------------------------
Yes, please open a new bug. Thanks!
> Typechecker does not detect shadowed generic parameter
> ------------------------------------------------------
>
> Key: GROOVY-5839
> URL: https://issues.apache.org/jira/browse/GROOVY-5839
> Project: Groovy
> Issue Type: Bug
> Components: Static Type Checker
> Affects Versions: 2.0.5
> Reporter: Dimitar Dimitrov
> Assignee: Jochen Theodorou
> Fix For: 2.1.7, 2.2.0-beta-2
>
>
> The typechecker does not realize that the <T> of the method shadows the <T>
> of the class and compiles this code without warning. The same code does not
> typecheck in Java.
> {code}
> public class GoodCodeRed<T> {
> Collection<GoodCodeRed<T>> attached
> @groovy.transform.CompileStatic
> public <T> void attach(GoodCodeRed<T> toAttach) {
> attached.add(toAttach)
> }
> }
> {code}
> See also http://youtrack.jetbrains.com/issue/IDEA-96606
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)