diff --git a/Upsilon/BaseTypes/ScriptFunction/ScriptRuntimeFunction.cs b/Upsilon/BaseTypes/ScriptFunction/ScriptRuntimeFunction.cs index f3e93ea..4f8fe59 100644 --- a/Upsilon/BaseTypes/ScriptFunction/ScriptRuntimeFunction.cs +++ b/Upsilon/BaseTypes/ScriptFunction/ScriptRuntimeFunction.cs @@ -41,11 +41,11 @@ namespace Upsilon.BaseTypes.ScriptFunction { if (option.Parameters.Length != variables.Length) continue; - bool isCompatible = true; + var isCompatible = true; for (var index = 0; index < variables.Length; index++) { var parameter = option.Parameters[index]; - var parameterSymbol = ((UserDataVariableSymbol)parameter.VariableSymbol); + var parameterSymbol = ((UserDataVariableSymbol) parameter.VariableSymbol); var parameterType = variables[index].GetType(); if (parameterSymbol.BoundTypeDefinition != null) { diff --git a/Upsilon/Binder/Binder.cs b/Upsilon/Binder/Binder.cs index 5468bf0..f3ae074 100644 --- a/Upsilon/Binder/Binder.cs +++ b/Upsilon/Binder/Binder.cs @@ -245,7 +245,7 @@ namespace Upsilon.Binder } UnboundFunctionExpression unbound = null; - foreach (var functionExpression in this._unboundFunctions.Where(x => + foreach (var functionExpression in _unboundFunctions.Where(x => { if (x.Name == function.Name) { diff --git a/Upsilon/Binder/VariableSymbols/InternalFunctionVariableSymbol.cs b/Upsilon/Binder/VariableSymbols/InternalFunctionVariableSymbol.cs index 87a232f..8f7de5b 100644 --- a/Upsilon/Binder/VariableSymbols/InternalFunctionVariableSymbol.cs +++ b/Upsilon/Binder/VariableSymbols/InternalFunctionVariableSymbol.cs @@ -39,8 +39,7 @@ namespace Upsilon.Binder.VariableSymbols var callingParameter = callingParameters[i]; if (callingParameter.Type == Type.Unknown || callingParameter.Type == Type.Nil) { - isValid = false; - break; + continue; } if (!functionParameter.ValidTypes.Type.HasFlag(callingParameter.Type)) diff --git a/Upsilon/BoundTypes/UserDataBoundTypeDefinition.cs b/Upsilon/BoundTypes/UserDataBoundTypeDefinition.cs index 75038b1..f4a913b 100644 --- a/Upsilon/BoundTypes/UserDataBoundTypeDefinition.cs +++ b/Upsilon/BoundTypes/UserDataBoundTypeDefinition.cs @@ -84,7 +84,10 @@ namespace Upsilon.BoundTypes else { methods.Add(methodName, - new UserDataBoundMethod(methodName, new List() {option})); + new UserDataBoundMethod(methodName, new List() {option}) + { + Type = Type.Function + }); } }