diff --git a/Upsilon/Evaluator/Evaluator.cs b/Upsilon/Evaluator/Evaluator.cs index 00458d4..c233640 100644 --- a/Upsilon/Evaluator/Evaluator.cs +++ b/Upsilon/Evaluator/Evaluator.cs @@ -220,6 +220,8 @@ namespace Upsilon.Evaluator innerEvaluator.EvaluateStatement(boundBlockStatement.ElseStatement.Block); } HasReturned = innerEvaluator.HasReturned; + if (HasReturned) + _returnValue = innerEvaluator._returnValue; _lastValue = innerEvaluator._lastValue; }