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/03/18 13:53:49 UTC

[groovy] branch master updated: GROOVY-7419: add test case

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 1420789  GROOVY-7419: add test case
1420789 is described below

commit 14207891aaf57ac5fd2e1f6db686ab079c0f81a8
Author: Eric Milles <er...@thomsonreuters.com>
AuthorDate: Thu Mar 18 08:53:38 2021 -0500

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

diff --git a/src/test/groovy/transform/stc/GenericsSTCTest.groovy b/src/test/groovy/transform/stc/GenericsSTCTest.groovy
index 536622b..acf0105 100644
--- a/src/test/groovy/transform/stc/GenericsSTCTest.groovy
+++ b/src/test/groovy/transform/stc/GenericsSTCTest.groovy
@@ -231,11 +231,22 @@ class GenericsSTCTest extends StaticTypeCheckingTestCase {
         assertScript '''
             Set<Number> set = new HashSet<Number>(Arrays.asList(0L))
         '''
+
+        assertScript '''
+            Set<? super Number> set = new HashSet<>(Arrays.asList(0L))
+        '''
+
+        assertScript '''
+            Set<? extends Number> set = new HashSet<>(Arrays.asList(0L))
+        '''
     }
 
+    // GROOVY-7419
     void testDiamondInferrenceFromConstructor4() {
         assertScript '''
-            Set<? extends Number> set = new HashSet<>(Arrays.asList(0L))
+            Map<Thread.State, Object> map = new EnumMap<>(Thread.State)
+            assert map.size() == 0
+            assert map.isEmpty()
         '''
     }