You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2019/11/02 14:53:06 UTC

[groovy] branch GROOVY_3_0_X updated: Add one more test for `with` under STC mode

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

sunlan 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 ac29754  Add one more test for `with` under STC mode
ac29754 is described below

commit ac29754edc8a502c9f68edf4c684ce1fb28e79de
Author: Daniel Sun <su...@apache.org>
AuthorDate: Sat Nov 2 22:50:26 2019 +0800

    Add one more test for `with` under STC mode
    
    (cherry picked from commit eff9a23745b03d582c4f35b8014c4f8ec162eaf6)
---
 src/test/groovy/transform/stc/WithSTCTest.groovy | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/src/test/groovy/transform/stc/WithSTCTest.groovy b/src/test/groovy/transform/stc/WithSTCTest.groovy
index 083346a..cd6d5db 100644
--- a/src/test/groovy/transform/stc/WithSTCTest.groovy
+++ b/src/test/groovy/transform/stc/WithSTCTest.groovy
@@ -62,4 +62,19 @@ class WithSTCTest extends StaticTypeCheckingTestCase {
             assert Test.a( 'Daniel' ) == 6 
         '''
     }
+
+    void testLongReturnType() {
+        assertScript '''
+            class Test {
+               static long a() {
+                    Long.with {
+                        MAX_VALUE
+                    }
+                }
+            }
+
+            assert Test.a() == Long.MAX_VALUE
+        '''
+    }
 }
+