path: root/parse
diff options
authorMichael Forney <>2017-07-03 11:52:32 -0700
committerOri Bernstein <>2017-07-03 12:43:37 -0700
commitddb327c92ebe3f96c5c816ec61996440551de401 (patch)
tree83bc341e072f22f5fcde9920eaaa30b808046be0 /parse
parentf358e29be6bb61572de6891a5f098fcbefe5d0b1 (diff)
Resolve trait decl types before fixing them
Otherwise, if the decl has a named type with parameters, it remains unresolved until tyfix. tyfix looks up the tid in tytab, finding the original definition of the named type, which may have different type parameter names than than used in the trait decl. Upon importing this trait from a use file and writing a new impl, we end up trying to resolve type parameters of the *definition* of the named type, rather than what is specified in the trait decl type. If both type parameters are the same, we don't notice a problem, but if they differ, we end up trying to serialize a Tyvar in genericname. tyvar has no idstr
Diffstat (limited to 'parse')
1 files changed, 1 insertions, 1 deletions
diff --git a/parse/infer.c b/parse/infer.c
index dcaf1c4..fcf0161 100644
--- a/parse/infer.c
+++ b/parse/infer.c
@@ -2005,7 +2005,7 @@ static Type *tyfix(Inferstate *st, Node *ctx, Type *orig, int noerr)
if (!tyflt)
tyflt = mktype(Zloc, Tyflt64);
- t = tysearch(orig);
+ t = tysearch(tf(st, orig));
base = htget(st->seqbase, orig);
if (orig->type == Tyvar && hthas(st->delayed, orig)) {
delayed = htget(st->delayed, orig);