diff --git a/Upsilon/Binder/Binder.cs b/Upsilon/Binder/Binder.cs index 0feac07..f433c5b 100644 --- a/Upsilon/Binder/Binder.cs +++ b/Upsilon/Binder/Binder.cs @@ -52,7 +52,9 @@ namespace Upsilon.Binder (BoundBlockStatement) BindBlockStatement(unboundFunctionStatement.Value.UnboundBlock); var resultType = Scope.ReturnType; Scope = Scope.ParentScope; - var variable = (FunctionVariableSymbol)Scope.Variables[unboundFunctionStatement.Key]; + var variable = + (FunctionVariableSymbol) unboundFunctionStatement.Value.Scope.ParentScope.Variables[ + unboundFunctionStatement.Key]; variable.IsBound = true; variable.ResultType = resultType; }