Fixed tables in script runtime functions breaking
This commit is contained in:
parent
65ae6f6f06
commit
ee36060dd6
|
@ -47,19 +47,19 @@ namespace Upsilon.BaseTypes.ScriptFunction
|
|||
for (var index = 0; index < variables.Length; index++)
|
||||
{
|
||||
var parameter = option.Parameters[index];
|
||||
var parameterSymbol = ((UserDataVariableSymbol) parameter.VariableSymbol);
|
||||
var v = variables[index];
|
||||
if (v == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
System.Type parameterType;
|
||||
if (v is GenericUserData ud)
|
||||
parameterType = ud.GetCSharpType();
|
||||
else
|
||||
parameterType = v.GetType();
|
||||
|
||||
if (parameter.VariableSymbol is UserDataVariableSymbol parameterSymbol)
|
||||
{
|
||||
if (parameterSymbol.BoundTypeDefinition != null)
|
||||
{
|
||||
var validSymbol =
|
||||
|
@ -79,6 +79,15 @@ namespace Upsilon.BaseTypes.ScriptFunction
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (parameter.VariableSymbol is TableVariableSymbol tableVariableSymbol)
|
||||
{
|
||||
if (parameterType.GetScriptType() != BaseTypes.Type.Table)
|
||||
{
|
||||
isCompatible = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!isCompatible)
|
||||
continue;
|
||||
return option;
|
||||
|
|
Loading…
Reference in New Issue