summaryrefslogtreecommitdiff
path: root/parse/specialize.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2016-02-01 23:23:23 -0800
committerOri Bernstein <ori@eigenstate.org>2016-02-01 23:23:23 -0800
commit1a1892e5a47ac3c1ab1b1944ee1ee11fc3d1e3c8 (patch)
tree32e4184c2ebd349a22d17cb206a1b50732ceaa03 /parse/specialize.c
parent41f58088d668a208e560de1eecdc7c69582862ca (diff)
downloadmc-1a1892e5a47ac3c1ab1b1944ee1ee11fc3d1e3c8.tar.gz
Don't duplicate type variables.
These should unify across generics.
Diffstat (limited to 'parse/specialize.c')
-rw-r--r--parse/specialize.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/parse/specialize.c b/parse/specialize.c
index 7874eee..d8777f8 100644
--- a/parse/specialize.c
+++ b/parse/specialize.c
@@ -151,13 +151,11 @@ Type *tyspecialize(Type *orig, Tysubst *tsmap, Htab *delayed)
}
break;
case Tyvar:
+ ret = t;
if (delayed && hthas(delayed, t)) {
- ret = tydup(t);
tmp = htget(delayed, t);
htput(delayed, ret, tyspecialize(tmp, tsmap, delayed));
- } else {
- ret = t;
- }
+ }
break;
default:
if (t->nsub > 0) {