From f93d77b9de1eb5ab3acd7e1e2d033fa1a8f75a3d Mon Sep 17 00:00:00 2001 From: evan-schott <53463459+evan-schott@users.noreply.github.com> Date: Mon, 22 Apr 2024 13:23:55 -0700 Subject: [PATCH] Fix bug where `return self.caller` caused panic --- compiler/passes/src/flattening/flatten_statement.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/passes/src/flattening/flatten_statement.rs b/compiler/passes/src/flattening/flatten_statement.rs index 9a47421112..755e282e7a 100644 --- a/compiler/passes/src/flattening/flatten_statement.rs +++ b/compiler/passes/src/flattening/flatten_statement.rs @@ -273,7 +273,7 @@ impl StatementReconstructor for Flattener<'_> { let guard = self.construct_guard(); match input.expression { - Expression::Unit(_) | Expression::Identifier(_) => self.returns.push((guard, input)), + Expression::Unit(_) | Expression::Identifier(_) | Expression::Access(_) => self.returns.push((guard, input)), _ => unreachable!("SSA guarantees that the expression is always an identifier or unit expression."), };