wixette / isb

Interactive Small Basic (ISB) - Simple scripting language to be embedded in Unity games or shell environments.
https://www.nuget.org/packages/ISB/
Apache License 2.0
24 stars 3 forks source link

Unhandled exception when ArrayValue is passed into a lib function #1

Closed wixette closed 3 years ago

wixette commented 3 years ago
] a[0] = 0
] math.floor(a)

Unhandled exception. System.ArgumentException: Object of type 'ISB.Runtime.ArrayValue' cannot be converted to type 'ISB.Runtime.NumberValue'. at System.RuntimeType.TryChangeType(Object value, Binder binder, CultureInfo culture, Boolean needsSpecialCast) at System.RuntimeType.CheckValue(Object value, Binder binder, CultureInfo culture, BindingFlags invokeAttr) at System.Reflection.MethodBase.CheckArguments(Object[] parameters, Binder binder, BindingFlags invokeAttr, CultureInfo culture, Signature sig) at System.Reflection.RuntimeMethodInfo.InvokeArgumentsCheck(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) at ISB.Runtime.Libraries.InvokeFunction(String libName, String functionName, Object[] parameters) in /Users/ygwang/src/isb/csharp/ISB/Runtime/Libraries.cs:line 92 at ISB.Runtime.Engine.ExecuteInstruction(Instruction instruction) in /Users/ygwang/src/isb/csharp/ISB/Runtime/Engine.cs:line 381 at ISB.Runtime.Engine.ExecuteAssembly() in /Users/ygwang/src/isb/csharp/ISB/Runtime/Engine.cs:line 121 at ISB.Runtime.Engine.Run(Boolean reset) in /Users/ygwang/src/isb/csharp/ISB/Runtime/Engine.cs:line 101 at ISB.Shell.Program.Evaluator.Eval(String line) in /Users/ygwang/src/isb/csharp/ISB.Shell/Program.cs:line 214 at ISB.Shell.REPL.Loop() in /Users/ygwang/src/isb/csharp/ISB.Shell/REPL.cs:line 51 at ISB.Shell.Program.StartREPL() in /Users/ygwang/src/isb/csharp/ISB.Shell/Program.cs:line 235 at ISB.Shell.Program.RunOptions(Options opts) in /Users/ygwang/src/isb/csharp/ISB.Shell/Program.cs:line 89 /Users/ygwang/src/isb/csharp/ISB.Shell/Program.cs:line 45