CSharp.lua
CSharp.lua copied to clipboard
.GetType() produces a nil reference to System.ObjectGetType
Creating a simple test:
public class Test
{
public Test()
{
var a = this.GetType();
}
}
when compiled with the -p option
produces:
System.namespace("", function (namespace)
namespace.class("Test", function (namespace)
local __ctor__
__ctor__ = function (this)
local a = System.ObjectGetType(this)
end
return {
__ctor__ = __ctor__
}
end)
end)
However, ObjectGetType is nil and throws. Without the -p option, it functions just fine. It seems the intention is the ObjectGetType should be valid when using the -p option, but it is not added during the initialization.
In case it matters, I am compiling with -c -inline-property -p.
This is non-critical, as I am running in an environment where debug is available, but I had disabled it by default.
may you set "debug = nil",
CoreSystem if debug == nil
System.ObjectGetType may be define
In my case, debug is available and remains a workaround for me,
I wasn't sure if this was an issue that could be addressed for others, though.