groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel.Sun" <sun...@apache.org>
Subject Re: DGM wildcards
Date Sat, 08 Dec 2018 13:14:46 GMT
Hi  Marcin,

     As for the generics in Groovy, the issue I mostly wish to fix is
GROOVY-8409 ( https://issues.apache.org/jira/browse/GROOVY-8409 ).

     Apart from the discussion in the JIRA issue, here is some more thoughts
on the issue:
https://github.com/apache/groovy/blob/master/src/main/java/org/codehaus/groovy/ast/GenericsType.java#L505-L516

     The main cause of the issue is lacking scope info.

     As a note side, the following two L(1st -> String, 2nd -> GString) and
two R (1st -> Integer, 2nd -> Long) should be distinguished too, so only
declaring class is not enough, maybe we need enclosing generics type too.
```
class Pair<L, R> {}

                   L          R                        L             R
Pair<Pair&lt;String, Integer>, Pair<GString, Long>>
```

      If the issue could be fixed, it would be great.

Cheers,
Daniel.Sun



-----
Daniel Sun 
Apache Groovy committer 
Blog: http://blog.sunlan.me 
Twitter: @daniel_sun 

--
Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html

Mime
View raw message