ref: 6b36dc7cbdc29cf8cf03a815518948fa7599f3df
parent: cf6bdc408047197a6c2f46373a570f096a6e7b31
author: Ori Bernstein <[email protected]>
date: Thu Oct 10 09:51:16 EDT 2013
Add 'synth' parameter to types.
--- a/parse/parse.h
+++ b/parse/parse.h
@@ -115,6 +115,7 @@
size_t ncstrlist; /* The length of the constraint list above */
int isgeneric; /* Tyname: whether this is generic or not */
+ int issynth; /* Tyname: whether this is synthesized or not */
Type **param; /* Tyname: type parameters that match the type args */
size_t nparam; /* Tyname: count of type parameters */
Type **arg; /* Tyname: type arguments instantiated */
--- a/parse/specialize.c
+++ b/parse/specialize.c
@@ -63,6 +63,7 @@
htput(tsmap, t->param[i], tmp);
}
ret = mktyname(t->line, t->name, NULL, 0, tyspecialize(t->sub[0], tsmap));
+ ret->issynth = 1;
htput(tsmap, t, ret);
for (i = 0; i < t->nparam; i++)
lappend(&ret->arg, &ret->narg, tyspecialize(t->param[i], tsmap));
--- a/parse/use.c
+++ b/parse/use.c
@@ -214,6 +214,7 @@
case Tyname:
pickle(ty->name, fd);
wrbool(fd, ty->isgeneric);
+ wrbool(fd, ty->issynth);
wrint(fd, ty->narg);
for (i = 0; i < ty->narg; i++)
wrtype(fd, ty->arg[i]);
@@ -294,6 +295,7 @@
case Tyname:
ty->name = unpickle(fd);
ty->isgeneric = rdbool(fd);
+ ty->issynth = rdbool(fd);
ty->narg = rdint(fd);
ty->arg = zalloc(ty->narg * sizeof(Type *));
for (i = 0; i < ty->narg; i++)