From 237c83f511c33c8485565fc90c8ceabf33f039e8 Mon Sep 17 00:00:00 2001 From: Emi Simpson Date: Fri, 15 Mar 2024 19:28:54 -0400 Subject: [PATCH] Fix bug: Switch statements crash when switching to the fallback branch --- ir.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ir.py b/ir.py index 141d8b5..034e35e 100644 --- a/ir.py +++ b/ir.py @@ -278,7 +278,7 @@ class Switch: if n in self.branches: return Some(self.branches[n]) else: - return None + return Some(self.fallback) raise Exception('Attempted to switch on non-integer value') raise Exception('Unreachable')