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 2022/05/18 15:43:11 UTC
[groovy] branch master updated: GROOVY-10266: 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 c4fc2ad994 GROOVY-10266: add test case
c4fc2ad994 is described below
commit c4fc2ad994cedbd09e1557147129dde0b10f5ec1
Author: Eric Milles <er...@thomsonreuters.com>
AuthorDate: Wed May 18 10:42:58 2022 -0500
GROOVY-10266: add test case
---
src/test/groovy/transform/stc/GenericsSTCTest.groovy | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/src/test/groovy/transform/stc/GenericsSTCTest.groovy b/src/test/groovy/transform/stc/GenericsSTCTest.groovy
index 5490789a5e..b330ad771d 100644
--- a/src/test/groovy/transform/stc/GenericsSTCTest.groovy
+++ b/src/test/groovy/transform/stc/GenericsSTCTest.groovy
@@ -1345,6 +1345,26 @@ class GenericsSTCTest extends StaticTypeCheckingTestCase {
'''
}
+ // GROOVY-10266
+ void testDiamondInferrenceFromConstructor30() {
+ assertScript '''
+ @groovy.transform.TupleConstructor(defaults=false)
+ class A<T> {
+ T t
+ }
+ class B<U> {
+ def m() {
+ U v = null
+ U w = new A<>(v).t
+
+ String x = ""
+ String y = new A<>(x).t
+ }
+ }
+ new B<String>().m()
+ '''
+ }
+
// GROOVY-10280
void testTypeArgumentPropagation() {
assertScript '''