CSharp.lua
CSharp.lua copied to clipboard
Metadata ctor is incorrect
https://github.com/Drake53/CSharp.lua/issues/2
namespace Test {
public class A {
public A(int a, string b = null) {
}
}
public class Program
{
private static void Main(string[] args)
{
Activator.CreateInstance(typeof(A), 100);
}
}
}
i run this code in .NET6, it also got a exception, so in lua it will also got a error
Unhandled exception. System.MissingMethodException: Constructor on type 'Test.A' not found.
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(Type type, Object[] args)
at Test.Program.Main(String[] args) in C:\Person\Project\code\cstolua\cstolua\src\Progrom.cs:line 20