xLua
xLua copied to clipboard
Generator 对于 System.Reflection 中的匿名委托生成了错误代码
问题出现版本:Tag:v2.1.16 操作:将 ExampleConfig 中的注释全部打开,然后点击生成代码按钮,错误如下。
public <>f__AnonymousType1<System.Type, System.Reflection.MethodInfo> __Gen_Delegate_Imp52(System.Type p0, System.Reflection.MethodInfo p1)
{
#if THREAD_SAFE || HOTFIX_ENABLE
lock (luaEnv.luaEnvLock)
{
#endif
RealStatePtr L = luaEnv.rawL;
int errFunc = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference);
ObjectTranslator translator = luaEnv.translator;
translator.Push(L, p0);
translator.Push(L, p1);
PCall(L, 2, 1, errFunc);
<>f__AnonymousType1<System.Type, System.Reflection.MethodInfo> __gen_ret = (<>f__AnonymousType1<System.Type, System.Reflection.MethodInfo>)translator.GetObject(L, errFunc + 1, typeof(<>f__AnonymousType1<System.Type, System.Reflection.MethodInfo>));
LuaAPI.lua_settop(L, errFunc - 1);
return __gen_ret;
#if THREAD_SAFE || HOTFIX_ENABLE
}
#endif
}
ExampleConfig是个配置示例,里头可以加上版本特定的过滤规则