Fixes for modules and function binding
This commit is contained in:
parent
3737ac826c
commit
01d408e5fd
|
@ -77,6 +77,9 @@ namespace Upsilon.BaseTypes.ScriptFunction
|
||||||
{
|
{
|
||||||
var callingVariable = variables[index];
|
var callingVariable = variables[index];
|
||||||
var optionVariable = option.Parameters[index];
|
var optionVariable = option.Parameters[index];
|
||||||
|
if (callingVariable.Type == BaseTypes.Type.Unknown || callingVariable.Type == BaseTypes.Type.Nil ||
|
||||||
|
optionVariable.Type == BaseTypes.Type.Unknown)
|
||||||
|
continue;
|
||||||
if (callingVariable.Type != optionVariable.Type)
|
if (callingVariable.Type != optionVariable.Type)
|
||||||
{
|
{
|
||||||
isCompatible = false;
|
isCompatible = false;
|
||||||
|
|
|
@ -258,12 +258,16 @@ namespace Upsilon.Binder
|
||||||
unbound = functionExpression;
|
unbound = functionExpression;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
unbound.Block = (BoundBlockStatement) BindBlockStatement(unbound.UnboundBlock);
|
|
||||||
|
|
||||||
returnType = Scope.ReturnType;
|
if (unbound != null)
|
||||||
Scope = Scope.ParentScope;
|
{
|
||||||
functionOption.IsBound = true;
|
unbound.Block = (BoundBlockStatement) BindBlockStatement(unbound.UnboundBlock);
|
||||||
functionOption.ResultType = returnType;
|
|
||||||
|
returnType = Scope.ReturnType;
|
||||||
|
Scope = Scope.ParentScope;
|
||||||
|
functionOption.IsBound = true;
|
||||||
|
functionOption.ResultType = returnType;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue