groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pascalschumac...@apache.org
Subject incubator-groovy git commit: GROOVY-7691: Create a test (closes #198)
Date Sat, 28 Nov 2015 10:08:29 GMT
Repository: incubator-groovy
Updated Branches:
  refs/heads/GROOVY_2_4_X b2df60e7c -> f3c96fc06


GROOVY-7691: Create a test (closes #198)


Project: http://git-wip-us.apache.org/repos/asf/incubator-groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-groovy/commit/f3c96fc0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-groovy/tree/f3c96fc0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-groovy/diff/f3c96fc0

Branch: refs/heads/GROOVY_2_4_X
Commit: f3c96fc06c0079a83270af71c6c61e80cf15ae65
Parents: b2df60e
Author: Frank Pavageau <fpavageau@ekino.com>
Authored: Thu Nov 26 23:37:46 2015 +0100
Committer: pascalschumacher <pascalschumacher@gmx.net>
Committed: Sat Nov 28 11:08:18 2015 +0100

----------------------------------------------------------------------
 .../groovy/transform/stc/GenericsSTCTest.groovy | 24 ++++++++++++++++++++
 1 file changed, 24 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-groovy/blob/f3c96fc0/src/test/groovy/transform/stc/GenericsSTCTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/transform/stc/GenericsSTCTest.groovy b/src/test/groovy/transform/stc/GenericsSTCTest.groovy
index ec8992e..f69e55a 100644
--- a/src/test/groovy/transform/stc/GenericsSTCTest.groovy
+++ b/src/test/groovy/transform/stc/GenericsSTCTest.groovy
@@ -1666,6 +1666,30 @@ assert result == 'ok'
         '''
     }
 
+    // GROOVY-7691
+    @NotYetImplemented
+    void testCovariantGenericField() {
+        assertScript '''
+            abstract class AbstractNumberWrapper<S extends Number> {
+                protected final S number;
+
+                AbstractNumberWrapper(S number) {
+                    this.number = number
+                }
+            }
+            class LongWrapper<S extends Long> extends AbstractNumberWrapper<S>
{
+                LongWrapper(S longNumber) {
+                    super(longNumber)
+                }
+
+                S getValue() {
+                    return number;
+                }
+            }
+            assert new LongWrapper<Long>(42L).value == 42L
+'''
+    }
+
     static class MyList extends LinkedList<String> {}
 
     public static class ClassA<T> {


Mime
View raw message