const testNonGen typeof MyNamespace.TestNonGen -- Works fine
const testGen typeof MyNamespace.TestGen[System.Object] -- Parse error
const ListOfObjects typeof System.Collections.Generic.List[System.Object] --Works fine
local test = testNonGen()
local test2 = testGen()
namespace MyNamespace
{
public class TestGen<T>
{
public TestGen () {
Console.WriteLine("ctor called");
}
}
public class TestNonGen
{
public TestNonGen()
{
Console.WriteLine("ctor called");
}
}
}
So according to the documentation the proper way to reference clr generics is like the above. But only the non generic version works. For the generic version i get this:
Lua Parse Error System.TypeLoadException: Could not load type 'MyNamespace.TestGen`1' from assembly 'Neo.Lua, Version=5.3.0.0, Culture=neutral, PublicKeyToken=fdb0cd4fe8a6e3b2'.
at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)
at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName)
at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
at System.Type.GetType(String typeName, Boolean throwOnError)
NeoLua Version: 1.3.11
Example to reproduce:
So according to the documentation the proper way to reference clr generics is like the above. But only the non generic version works. For the generic version i get this:
The workaround is this:
This works fine. But I can't stop wondering why I can't use the method described in 05_01? This that only for System genereics and not custom ones?
PS. A new nuget release would also be very helpful :)