From c941b9a3325228eba404455afea7ccea0da45095 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 21 Sep 2025 17:44:08 -0400 Subject: Fix tests --- src/environment.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/environment.c') diff --git a/src/environment.c b/src/environment.c index 603a04d9..ccbe4a8f 100644 --- a/src/environment.c +++ b/src/environment.c @@ -573,10 +573,10 @@ env_t *fresh_scope(env_t *env) { } env_t *with_enum_scope(env_t *env, type_t *t) { - while (t->tag == OptionalType) + while (t && t->tag == OptionalType) t = Match(t, OptionalType)->type; - if (t->tag != EnumType) return env; + if (t == NULL || t->tag != EnumType) return env; env = fresh_scope(env); env_t *ns_env = Match(t, EnumType)->env; for (tag_t *tag = Match(t, EnumType)->tags; tag; tag = tag->next) { -- cgit v1.2.3