xLua icon indicating copy to clipboard operation
xLua copied to clipboard

泛型类的泛型内部类,代码生成有问题

Open zhouwenkan opened this issue 4 years ago • 0 comments

虽然可能没人这么写代码,不过测试确实发现有问题; 例如定义下面这样的类型

    public class GGGG<A, B, C>
    {
        public class III<X, Y>
        {
            
        }
    }

LuaCallCSharp函数定义为

        public static GGGG<int, float, string>.III<int, float> Test(GGGG<int, float, string>.III<int, float> arg)
        {
            return null;
        }

那么生成的wrapper对泛型参数的生成是错的 ``` [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] static int m_Test_xlua_st(RealStatePtr L) { try {

            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
        
        
        
            
            {
                Garden.GGGG<int, float, string, int, float>.III<int, float, string, int, float> _arg = (Garden.GGGG<int, float, string, int, float>.III<int, float, string, int, float>)translator.GetObject(L, 1, typeof(Garden.GGGG<int, float, string, int, float>.III<int, float, string, int, float>));
                
                    var gen_ret = Garden.LuaHelper.Test( _arg );
                    translator.Push(L, gen_ret);
                
                
                
                return 1;
            }
            
        } catch(System.Exception gen_e) {
            return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
        }
        
    }

zhouwenkan avatar Dec 09 '21 10:12 zhouwenkan