summaryrefslogtreecommitdiff
path: root/parse/dump.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2014-09-28 17:01:40 -0400
committerOri Bernstein <ori@eigenstate.org>2014-09-28 17:01:40 -0400
commite414e8418b0ca9dd8d49894d96ef37b12276da16 (patch)
tree57e857774c8f5f72f0c96c0b19f40294d534f2d2 /parse/dump.c
parentffde89c0d1f71d292d3b5cafeebe91a7ec2282bf (diff)
downloadmc-e414e8418b0ca9dd8d49894d96ef37b12276da16.tar.gz
Fix premature unification in generics.
We used to unify generics prematurely, meaning that if we had a generic being used before the declaration was fully inferred, we would fix it's type at the first use. This would cause errors when we tried to use it with a different type. A demonstration of this bug is below: const main = { id("asdf") /* we decided that id (byte[:] -> $t) */ id(123) /* type error: (byte[:] -> $t) is not compatible with (intline -> $t) */ } generic id = {x : @a -> x }
Diffstat (limited to 'parse/dump.c')
-rw-r--r--parse/dump.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/parse/dump.c b/parse/dump.c
index dba4826..496ab65 100644
--- a/parse/dump.c
+++ b/parse/dump.c
@@ -233,3 +233,8 @@ void dump(Node *n, FILE *fd)
{
outnode(n, fd, 0);
}
+
+void dumpn(Node *n)
+{
+ dump(n, stdout);
+}