Fix bug: Switch statements crash when switching to the fallback branch

This commit is contained in:
Emi Simpson 2024-03-15 19:28:54 -04:00
parent f04553ac4d
commit 237c83f511
Signed by: Emi
GPG Key ID: A12F2C2FFDC3D847
1 changed files with 1 additions and 1 deletions

2
ir.py
View File

@ -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')