GameCTO / luainterface

Automatically exported from code.google.com/p/luainterface
0 stars 0 forks source link

'Common Language Runtime detected an invalid program' Error when calling a method in dynamic type? #33

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Define a class with a few methods.
2. Have Lua make_object with an empty table.
3. Pass the table to .Net.
3. Call one of the methods from .Net, and there's your error.

What is the expected output? What do you see instead?
The virtual method to execute properly.

What version of the product are you using? On what operating system?
Visual Studio 2010, .Net 4, Windows 7, Latest LuaInterface (Built Manually)

Please provide any additional information below.
From what I can see, your generated IL code (When you make_object) is 
incorrect, therefore causing the unhelpful error in the title of this post.

What I'm actually trying to do:
I've made a 'Master' class for a series of child classes, where the default 
values and the default methods have been written (Ofc the methods are all 
virtual).
Each one of these children classes changes some, but not all, of the default 
values and methods.

I wish to allow Lua to do the same, using make_object, or any other method, so 
that my users can define their own child classes for my application.

Original issue reported on code.google.com by ruir...@live.co.uk on 10 May 2011 at 7:25