summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-09-23 00:48:25 -0700
committerOri Bernstein <ori@eigenstate.org>2017-09-23 00:48:25 -0700
commit466e33d95d9da9d218952c836d99c75ac2142b05 (patch)
tree50ffdbc9e206d060d166892e0e9ef9eae8d1cf23
parent444b77956c15d1895a64891ca16f8313fdb00b9c (diff)
downloadmc-466e33d95d9da9d218952c836d99c75ac2142b05.tar.gz
Remove obsolete assert.
-rw-r--r--parse/infer.c3
-rw-r--r--test/pkgtrait.myr1
2 files changed, 2 insertions, 2 deletions
diff --git a/parse/infer.c b/parse/infer.c
index daa3727..77749de 100644
--- a/parse/infer.c
+++ b/parse/infer.c
@@ -895,8 +895,7 @@ tryconstrain(Type *base, Trait *tr)
if (tymatchrank(tm->filter[i], ty) >= 0)
return 1;
}
- assert(ty->nsub == 1);
- if (!ty->sub)
+ if (!ty->sub || ty->nsub != 1)
break;
ty = ty->sub[0];
tm = tm->sub[ty->type];
diff --git a/test/pkgtrait.myr b/test/pkgtrait.myr
index 7825937..40eb594 100644
--- a/test/pkgtrait.myr
+++ b/test/pkgtrait.myr
@@ -10,4 +10,5 @@ impl disposable regex.regex# =
const main = {
var auto r : regex.regex#
r = std.try(regex.compile(".*"))
+ std.exit(42)
}