From 41e0e31b8586c1f93b5e65cd62ef910227a6677d Mon Sep 17 00:00:00 2001 From: Mel Date: Sat, 24 May 2025 14:18:51 +0200 Subject: Failure when default case reached in non-optional switch functions Signed-off-by: Mel --- boot/lex.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'boot/lex.c') diff --git a/boot/lex.c b/boot/lex.c index 0fc6ed1..c66d160 100644 --- a/boot/lex.c +++ b/boot/lex.c @@ -275,7 +275,8 @@ token_kind_to_string(enum Token_Kind kind) return "ASSIGN_RIGHT_SHIFT"; default: - return ""; + failure("unknown token kind passed to `token_kind_to_string`"); + return nil; } } -- cgit 1.4.1