Browse files

Handle aliased intersection types correctly

  • Loading branch information...
1 parent 5179821 commit b52ba5ed0b8535b4c7399acb32a93c7c09d31cba @mwh committed Jun 1, 2012
Showing with 10 additions and 1 deletion.
  1. +10 −1 subtype.grace
View
11 subtype.grace
@@ -68,7 +68,16 @@ method resetType(t) {
matrix.get(d2).put(d, true)
if (d2 == d) then {
for (t.methods) do {tm->
- t2.methods.push(tm)
+ // Sometimes recurses - don't add methods twice
+ var found := false
+ for (t2.methods) do {tm2->
+ if (tm.value == tm2.value) then {
+ found := true
+ }
+ }
+ if (!found) then {
+ t2.methods.push(tm)
+ }
}
}
}

0 comments on commit b52ba5e

Please sign in to comment.