Bind functions even when they're not called, but with `Unknown` type parameters
This commit is contained in:
parent
da6e95bfac
commit
eff60375ea
|
@ -25,6 +25,19 @@ namespace Upsilon.Binder
|
|||
public BoundScript BindScript(BlockStatementSyntax e)
|
||||
{
|
||||
var bound = BindStatement(e);
|
||||
foreach (var unboundFunctionStatement in _unboundFunctions)
|
||||
{
|
||||
_scope = new BoundScope(_scope);
|
||||
foreach (var valueParameter in unboundFunctionStatement.Value.Parameters)
|
||||
{
|
||||
_scope.SetVariable(valueParameter);
|
||||
}
|
||||
unboundFunctionStatement.Value.Block =
|
||||
(BoundBlockStatement) BindBlockStatement(unboundFunctionStatement.Value.UnboundBlock);
|
||||
_scope = _scope.ParentScope;
|
||||
unboundFunctionStatement.Key.IsBound = true;
|
||||
}
|
||||
_unboundFunctions = new Dictionary<FunctionVariableSymbol, UnboundFunctionStatement>();
|
||||
return new BoundScript(bound);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue