Skip to content

Metadata ctor is incorrect #396

Open

Description

@Drake53

Activity

  1. yanghuan commented on Aug 1, 2022

    @yanghuan
    Owner
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions