summaryrefslogtreecommitdiff
path: root/mi
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-12-15 00:53:20 -0800
committerOri Bernstein <ori@eigenstate.org>2015-12-15 00:53:20 -0800
commita80975b0c347277095c091650daaa8a18ad67702 (patch)
treeb6e433110998b182172aaeb5abd1bec5200d3fdc /mi
parent3aec3caf0f75feec908fca6e387e7d50ae208d33 (diff)
downloadmc-a80975b0c347277095c091650daaa8a18ad67702.tar.gz
Allow matching a single void.
Void has 1 constructor, not 0.
Diffstat (limited to 'mi')
-rw-r--r--mi/match.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/mi/match.c b/mi/match.c
index bfca0a6..deac3e6 100644
--- a/mi/match.c
+++ b/mi/match.c
@@ -165,7 +165,7 @@ static size_t nconstructors(Type *t)
t = tybase(t);
switch (t->type) {
- case Tyvoid: return 0; break;
+ case Tyvoid: return 1; break;
case Tybool: return 2; break;
case Tychar: return 0x10ffff; break;
@@ -338,6 +338,9 @@ static int addwildrec(Srcloc loc, Type *ty, Dtree *start, Dtree *accept, Dtree *
ret = acceptall(start, accept);
lappend(&last, &nlast, accept);
break;
+ case Tyvoid:
+ ret = 1;
+ break;
default:
lappend(&last, &nlast, accept);
break;