You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by em...@apache.org on 2021/08/17 16:58:08 UTC

[groovy] branch GROOVY_3_0_X updated: GROOVY-9064: add test case

This is an automated email from the ASF dual-hosted git repository.

emilles pushed a commit to branch GROOVY_3_0_X
in repository https://gitbox.apache.org/repos/asf/groovy.git


The following commit(s) were added to refs/heads/GROOVY_3_0_X by this push:
     new 23094d0  GROOVY-9064: add test case
23094d0 is described below

commit 23094d095f036a9eec3101c26c9f4d3c717ec053
Author: Eric Milles <er...@thomsonreuters.com>
AuthorDate: Tue May 4 16:50:12 2021 -0500

    GROOVY-9064: add test case
    
    Conflicts:
    	src/test/groovy/transform/stc/GenericsSTCTest.groovy
---
 src/test/groovy/transform/stc/GenericsSTCTest.groovy | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/test/groovy/transform/stc/GenericsSTCTest.groovy b/src/test/groovy/transform/stc/GenericsSTCTest.groovy
index 90e74f5..7dd91f4 100644
--- a/src/test/groovy/transform/stc/GenericsSTCTest.groovy
+++ b/src/test/groovy/transform/stc/GenericsSTCTest.groovy
@@ -167,6 +167,18 @@ class GenericsSTCTest extends StaticTypeCheckingTestCase {
         '''
     }
 
+    // GROOVY-9064
+    void testReturnTypeInferenceWithGenerics() {
+        assertScript '''
+            List getSomeRows() { [new String[]{'x'}] }
+            List<String[]> rows = getSomeRows()
+            rows.each { row ->
+                def col = row[0].toUpperCase()
+                assert col == 'X'
+            }
+        '''
+    }
+
     void testReturnTypeInferenceWithMethodGenerics() {
         assertScript '''
             List<Long> list = Arrays.asList([0L,0L] as Long[])