From cc029d0689179015aa81b354416f20b45d619464 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Wed, 28 Nov 2018 13:36:20 +0100 Subject: [PATCH] Handle binding unbound functions later better --- Upsilon/Binder/Binder.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; }