[
https://issues.apache.org/jira/browse/GROOVY-4356?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15434358#comment-15434358
]
ASF GitHub Bot commented on GROOVY-4356:
----------------------------------------
GitHub user paulk-asert opened a pull request:
https://github.com/apache/groovy/pull/393
GROOVY-4356: Static members should not be able to access class-level …
…generic types
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/paulk-asert/groovy groovy4356
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/groovy/pull/393.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #393
----
commit 74731579d4a857adaf1c4eab1b7812c72a639600
Author: paulk <[email protected]>
Date: 2016-08-24T07:28:27Z
GROOVY-4356: Static members should not be able to access class-level
generic types
----
> Static members should not be able to access class-level generic types
> ---------------------------------------------------------------------
>
> Key: GROOVY-4356
> URL: https://issues.apache.org/jira/browse/GROOVY-4356
> Project: Groovy
> Issue Type: Bug
> Components: class generator
> Affects Versions: 1.8-beta-1
> Reporter: Roshan Dawrani
>
> The following code compiles, but it shouldn't because T is a non-static
> generic type, and difference instances of Outer will have different concrete
> representations of T. Hence it makes no sense that static inner classes
> should be able to use such generic type variables.
> {code}
> class Outer<T> {
> T ofoo
> static class Inner {
> T ifoo
> }
> }
> {code}
> Similarly, all the cases below should not compile as well:
> {code}
> class Test1<T> {
> static T f1
> }
> class Test2<T> {
> static foo(T param1) {}
> }
> class Test3<T> {
> static foo() {
> T localVar1
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)