Closed Meigyoku-Thmn closed 1 year ago
NeoLua Version: 1.3.14 (Nuget)
Example to reproduce:
namespace Target { public class Program { [MethodImpl(MethodImplOptions.NoInlining)] static public string GetMessage() { return "Try to change this message."; } static void Main() { using (var l = new Lua()) { LuaType.RegisterTypeExtension(typeof(RuntimeReflectionExtensions)); var g = l.CreateEnvironment(); try { var chunk = l.CompileChunk(TestContent, "test.lua", new LuaCompileOptions() { DebugEngine = LuaStackTraceDebugger.Default }); g.DoChunk(chunk); } catch (Exception e) { Console.WriteLine("Expception: {0}", e.Message); var d = LuaExceptionData.GetData(e); Console.WriteLine("StackTrace: {0}", d.FormatStackTrace(0, false)); } } } const string TestContent = @" const Assembly typeof System.Reflection.Assembly local getMessageMethod = Assembly:GetEntryAssembly():GetType('Target.Program'):GetMethod('GetMessage') print(getMessageMethod) "; } }
Error message:
Expception: Value cannot be null. Parameter name: types
If I try to force the correct overload:
const string TestContent = @" const Assembly typeof System.Reflection.Assembly local getMessageMethod = Assembly:GetEntryAssembly():GetType('Target.Program'):GetMethod[string]('GetMessage') print(getMessageMethod) ";
Then I get this error:
Expception: Value cannot be null. Parameter name: name
The [string] does only work, if use the normal ., not the member call. Btw. the result of string is nil => clr.System.String.
[string]
.
string
nil
clr.System.String
EDIT: I need to add a test case!
NeoLua Version: 1.3.14 (Nuget)
Example to reproduce:
Error message:
If I try to force the correct overload:
Then I get this error: