diff --git a/Upsilon/Binder/BoundStatements/BoundIfStatement.cs b/Upsilon/Binder/BoundStatements/BoundIfStatement.cs index afe3dc0..d14ed51 100644 --- a/Upsilon/Binder/BoundStatements/BoundIfStatement.cs +++ b/Upsilon/Binder/BoundStatements/BoundIfStatement.cs @@ -64,14 +64,17 @@ namespace Upsilon.Binder var condition = Condition.Expression.Evaluate(scope, diagnostics, ref state); if ((ScriptBoolean) condition) { - return Block.EvaluateCoroutine(scope, diagnostics, state); + yield return Block.EvaluateCoroutine(scope, diagnostics, state); } if (NextElseIf != null) { - return NextElseIf.EvaluateCoroutine(scope, diagnostics, state); + yield return NextElseIf.EvaluateCoroutine(scope, diagnostics, state); + } + if (ElseStatement != null) + { + yield return ElseStatement.EvaluateCoroutine(scope, diagnostics, state); } - return ElseStatement?.EvaluateCoroutine(scope, diagnostics, state); } }