Skip to content
This repository
Browse code

Fix #134

  • Loading branch information...
commit 905bede93299f7712ef3b28922ab19567f1a0004 1 parent 2e14d35
Gavin King authored January 18, 2012
3  src/com/redhat/ceylon/compiler/typechecker/model/ProducedType.java
@@ -866,6 +866,9 @@ else if (getDeclaration() instanceof IntersectionType) {
866 866
             }
867 867
         }
868 868
         else {
  869
+            if (getQualifyingType()!=null) {
  870
+                getQualifyingType().checkVariance(covariant, contravariant, declaration, errors);
  871
+            }
869 872
             for (TypeParameter tp: getDeclaration().getTypeParameters()) {
870 873
                 ProducedType pt = getTypeArguments().get(tp);
871 874
                 if (pt!=null) {
17  test/main/typing/NestedVariance.ceylon
... ...
@@ -0,0 +1,17 @@
  1
+abstract class Co1<out T>(T t) {
  2
+    shared class Foo() {
  3
+        shared T get() { return t; } 
  4
+    } 
  5
+    shared void bar(@error Foo foo) {
  6
+        T t = foo.get();
  7
+    }
  8
+}
  9
+
  10
+abstract class Co2<out T>(T t) {
  11
+    shared class Foo() {
  12
+        shared T get() { return t; } 
  13
+    } 
  14
+    shared void bar(@error Co2<T>.Foo foo) {
  15
+        T t = foo.get();
  16
+    }
  17
+}

0 notes on commit 905bede

Please sign in to comment.
Something went wrong with that request. Please try again.