[ 
https://issues.apache.org/jira/browse/GROOVY-8611?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Eric Milles closed GROOVY-8611.
-------------------------------
    Resolution: Fixed

Current error: Cannot find matching method 
{{A#getFirstRecord(java.util.ArrayList<java.util.HashMap<java.lang.String, 
java.lang.Long>>)}}.

> Refine the generics presentation
> --------------------------------
>
>                 Key: GROOVY-8611
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8611
>             Project: Groovy
>          Issue Type: Improvement
>            Reporter: Daniel Sun
>            Priority: Major
>
> Nested generics should be shown as well, see the TODO in the following code:
> {code:java}
> class Groovy8609Bug extends CompilableTestSupport {
>     void testUpperBoundWithGenericsThroughWrongType2() {
>         def errMsg = shouldFail '''
>         @groovy.transform.CompileStatic
>         public class A<T extends List<E>, E extends Map<String, Integer>> {
>             E getFirstRecord(T recordList) {
>                 return recordList.get(0)
>             }
>             
>             static void main(args) {
>                 def list = new ArrayList<HashMap<String, Long>>()
>                 def record = new HashMap<String, Long>()
>                 list.add(record)
>                 def a = new A<ArrayList<HashMap<String, Integer>>, 
> HashMap<String, Integer>>()
>                 assert record.is(a.getFirstRecord(list))
>             }
>         }
>         '''
>         // TODO we should print generics details, e.g. [Static type checking] 
> - Cannot call A <ArrayList, HashMap<String, Integer>>#getFirstRecord(T) with 
> arguments [java.util.ArrayList <HashMap<String, Long>>]
>         assert errMsg.contains('[Static type checking] - Cannot call A 
> <ArrayList, HashMap>#getFirstRecord(T) with arguments [java.util.ArrayList 
> <HashMap>]')
>     }
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to