Fixed issue with no parameter funcs
This commit is contained in:
parent
4054f1d383
commit
1caf8320b3
|
@ -125,7 +125,7 @@ namespace Upsilon.BaseTypes
|
|||
if (t == typeof(ScriptType))
|
||||
return Type.Unknown;
|
||||
if (typeof(IEnumerable).IsAssignableFrom(t))
|
||||
return Type.Table | Type.Function;
|
||||
return Type.Table;
|
||||
return Type.UserData;
|
||||
}
|
||||
|
||||
|
|
|
@ -109,13 +109,16 @@ namespace Upsilon.StandardLibraries
|
|||
{
|
||||
var genericParameters = type.GetGenericArguments();
|
||||
var parameters = new List<InternalFunctionVariableSymbol.InternalFunctionParameter>();
|
||||
for (var i = 0; i < genericParameters.Length - 1; i++)
|
||||
if (genericParameters.Length > 1)
|
||||
{
|
||||
var t = DeriveValidTypes(genericParameters[i]);
|
||||
parameters.Add(new InternalFunctionVariableSymbol.InternalFunctionParameter(t, false));
|
||||
for (var i = 0; i < genericParameters.Length - 1; i++)
|
||||
{
|
||||
var t = DeriveValidTypes(genericParameters[i]);
|
||||
parameters.Add(new InternalFunctionVariableSymbol.InternalFunctionParameter(t, false));
|
||||
}
|
||||
}
|
||||
|
||||
var result = genericParameters[parameters.Count - 1].GetScriptType();
|
||||
var result = genericParameters[genericParameters.Length - 1].GetScriptType();
|
||||
return new InternalFunctionVariableSymbol(name, true, result, parameters.ToArray());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue