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/04/02 14:37:37 UTC

[groovy] branch master updated: GROOVY-8001: 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 85bee37  GROOVY-8001: add test case
85bee37 is described below

commit 85bee37838d41f449ccf060501894bf335758447
Author: Eric Milles <er...@thomsonreuters.com>
AuthorDate: Fri Apr 2 09:37:26 2021 -0500

    GROOVY-8001: add test case
---
 .../groovy/transform/stc/ArraysAndCollectionsSTCTest.groovy   | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/test/groovy/transform/stc/ArraysAndCollectionsSTCTest.groovy b/src/test/groovy/transform/stc/ArraysAndCollectionsSTCTest.groovy
index 35ac761..ceeb405 100644
--- a/src/test/groovy/transform/stc/ArraysAndCollectionsSTCTest.groovy
+++ b/src/test/groovy/transform/stc/ArraysAndCollectionsSTCTest.groovy
@@ -752,6 +752,17 @@ class ArraysAndCollectionsSTCTest extends StaticTypeCheckingTestCase {
             """
         }
 
+        // GROOVY-8001
+        assertScript '''
+            class C {
+                Map<String,Object> map
+            }
+            int value = 42
+            def c = new C()
+            c.map = [key:"$value"]
+            assert c.map['key'] == '42'
+        '''
+
         shouldFailWithMessages '''
             Map<String,Integer> map = [1:2]
         ''', 'Cannot assign java.util.LinkedHashMap <java.lang.Integer, java.lang.Integer> to: java.util.Map <String, Integer>'