diff --git a/samples/list.noja b/samples/list.noja index ddb3efd..84f2c7a 100644 --- a/samples/list.noja +++ b/samples/list.noja @@ -6,8 +6,12 @@ print('The list contains ', count(l), ' items.\n'); print('The list is: ', l, '.\n'); -fun fail() - assert(false); +fun fail(p, fail) +{ + if p == 5: + assert(false); + else + fail(p+1, fail); +} - -fail(); \ No newline at end of file +fail(0, fail); \ No newline at end of file diff --git a/src/runtime/o_builtins.c b/src/runtime/o_builtins.c index b064db5..b6ef4ad 100644 --- a/src/runtime/o_builtins.c +++ b/src/runtime/o_builtins.c @@ -68,11 +68,9 @@ static Object *select(Object *self, Object *key, Heap *heap, Error *err) return Object_FromNativeFunction(bm->runtime, bin_assert, -1, heap, err); return NULL; } - - default: NULL; } - UNREACHABLE; + // Not found. return NULL; }