uLua icon indicating copy to clipboard operation
uLua copied to clipboard

generating code for inaccessible constructor is unnecessary

Open c3076802 opened this issue 10 years ago • 0 comments

Say we have a class call AppConfigMgr has a private constructor only, ulua will export some unnecessary code

    public class AppConfigMgr  {
        private AppConfigMgr()
        {

        }
new LuaMethod("New", _CreateConfigs_AppConfigMgr),
static int _CreateConfigs_AppConfigMgr(IntPtr L)
    {
        LuaDLL.luaL_error(L, "Configs.AppConfigMgr class does not have a constructor function");
        return 0;
    }

Don't generate New when the constructor is inaccessible, Let lua handle the error when miss use.

Thank you

c3076802 avatar Oct 29 '15 07:10 c3076802