shithub: mc

Download patch

ref: 79b0e2e5efb8d17cefc6924752b97d499f3614e1
parent: 4ff354d845429eef262aba6e1c4b74fcd2c4fada
author: Ori Bernstein <[email protected]>
date: Mon May 19 20:28:57 EDT 2014

Tag exported types in traits.

    We used to fail because not all types were exported from a trait.

--- a/parse/infer.c
+++ b/parse/infer.c
@@ -1996,8 +1996,9 @@
             nodetag(st, n->func.body, ingeneric);
             break;
         case Nimpl:
+            for (i = 0; i < n->impl.ndecls; i++)
+                nodetag(st, n->impl.decls[i], 0);
             break;
-
         case Nuse: case Nname:
             break;
         case Nfile: case Nnone:
@@ -2019,6 +2020,10 @@
         nodetag(st, s, 0);
     }
     free(k);
+
+    for (i = 0; i < nexportimpls; i++) {
+        nodetag(st, exportimpls[i], 0);
+    }
 
     /* get the explicitly exported symbols */
     k = htkeys(st->ty, &n);
--- a/parse/use.c
+++ b/parse/use.c
@@ -650,7 +650,7 @@
             n->impl.ndecls = rdint(fd);
             n->impl.decls = zalloc(sizeof(Node *)*n->impl.ndecls);
             for (i = 0; i < n->impl.ndecls; i++)
-                n->impl.decls[i] = rdsym(fd, NULL);
+                n->impl.decls[i] = rdsym(fd, n->impl.trait);
             break;
         case Nnone:
             die("Nnone should not be seen as node type!");