Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metadata ctor is incorrect #396

Open
Drake53 opened this issue Jul 22, 2022 · 1 comment
Open

Metadata ctor is incorrect #396

Drake53 opened this issue Jul 22, 2022 · 1 comment

Comments

@Drake53
Copy link
Contributor

Drake53 commented Jul 22, 2022

Drake53#2

@yanghuan
Copy link
Owner

yanghuan commented Aug 1, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants