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/05/28 16:33:02 UTC

[groovy] branch master updated: GROOVY-5441: add test cases

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 8eddbe2  GROOVY-5441: add test cases
8eddbe2 is described below

commit 8eddbe2a1a24ee0a1d4eb8c0b95060da03cfdfb9
Author: Eric Milles <er...@thomsonreuters.com>
AuthorDate: Fri May 28 11:32:43 2021 -0500

    GROOVY-5441: add test cases
---
 src/test/gls/generics/GenericsUsageTest.groovy | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/src/test/gls/generics/GenericsUsageTest.groovy b/src/test/gls/generics/GenericsUsageTest.groovy
index a1469fe..35eb5fe 100644
--- a/src/test/gls/generics/GenericsUsageTest.groovy
+++ b/src/test/gls/generics/GenericsUsageTest.groovy
@@ -354,6 +354,23 @@ final class GenericsUsageTest extends CompilableTestSupport {
         ''', ['(supplied with 1 type parameter)', 'which takes 2 parameters']
     }
 
+    // GROOVY-5441
+    void testCompilationErrorForMismatchedGenericsWithQualifiedTypes() {
+        shouldFailCompilationWithMessages '''
+            groovy.lang.Tuple2<Object> tuple
+        ''', ['(supplied with 1 type parameter)', 'which takes 2 parameters']
+        shouldFailCompilationWithMessages '''
+            java.util.List<Object,Object> list
+        ''', ['(supplied with 2 type parameters)', 'which takes 1 parameter']
+        shouldFailCompilationWithMessages '''
+            java.util.Map<Object,Object,Object> map
+        ''', ['(supplied with 3 type parameters)', 'which takes 2 parameters']
+        shouldFailCompilationWithMessages '''
+            def (java.util.Map<Object> x, java.util.List<Object,Object> y) = [null,null]
+        ''', ['(supplied with 1 type parameter)', 'which takes 2 parameters',
+              '(supplied with 2 type parameters)', 'which takes 1 parameter']
+    }
+
     // GROOVY-8990
     void testCompilationErrorForMismatchedGenericsWithMultipleBounds() {
         shouldFailCompilationWithMessages '''