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:51:56 UTC
[groovy] branch master 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 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 eff9a23 Add one more test for `with` under STC mode
eff9a23 is described below
commit eff9a23745b03d582c4f35b8014c4f8ec162eaf6
Author: Daniel Sun <su...@apache.org>
AuthorDate: Sat Nov 2 22:50:26 2019 +0800
Add one more test for `with` under STC mode
---
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
+ '''
+ }
}
+