Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Commit

Permalink
solution for immediate problem in #3548
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinking committed Oct 26, 2012
1 parent 53c5514 commit 90d2b51
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,17 @@ private List<ProducedType> getSupertypes(List<ProducedType> list) {
List<ProducedType> caseTypes = getCaseTypes();
if (caseTypes!=null) {
for (ProducedType t: caseTypes) {
boolean already = false;
for (ProducedType pt: list) {
if (t.getDeclaration() instanceof UnionType ||
t.getDeclaration() instanceof IntersectionType ||
(t.getDeclaration().equals(pt.getDeclaration()) &&
t.isExactly(pt, true))) {
already=true;
break;
}
}
if (already) continue;
List<ProducedType> candidates = t.getSupertypes();
for (ProducedType st: candidates) {
boolean include = true;
Expand Down
7 changes: 6 additions & 1 deletion typechecker/test/main/typing/SelfType.ceylon
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,9 @@ class SelfTypeEquivalence4() {
Inv<X> l2 { throw; }
Inv<Self<X>> l3 = l2;
@error Inv<X> l4 = l1;
}
}

interface Aa {}
@error interface Bb satisfies Comparable<Bb&Aa> {}
@error interface Cc satisfies Comparable<Cc|Aa> {}
@error interface Zz satisfies Comparable<Bb|Cc|Aa> {}

0 comments on commit 90d2b51

Please sign in to comment.