xLua icon indicating copy to clipboard operation
xLua copied to clipboard

屏蔽匿名方法的生成, 屏蔽Protected参数的方法生成

Open sak9188 opened this issue 3 years ago • 5 comments

整合FairyGUI的时候, 用CodeGen生成代码,发现匿名方法, 还有Protected类型也会生成, 但是这样会导致编译错误,这里就屏蔽了匿名方法, 和Protected类型的方法生成

sak9188 avatar May 14 '22 10:05 sak9188

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

tencent-adm avatar May 14 '22 10:05 tencent-adm

在详细解释一下, 生成方法参数的类型是一个Nested Protected类型, xLua在外面无法直接访问到, 导致编译错误。上面可能没有解释的很清楚

sak9188 avatar May 14 '22 10:05 sak9188

这种比较少见的情况,用BlackList解决即可,BlackList是可以支持一个filter函数的: https://github.com/Tencent/xLua/blob/master/Assets/XLua/Editor/ExampleConfig.cs#L281

chexiongsheng avatar Mar 20 '23 03:03 chexiongsheng

这种用户没有动任何配置,却无法生成正确的代码的情况,是应该被修复的。我认为这个 PR 应该被合并。

这样对于新用户友好。用户不需要自己写黑名单就可以避免这种问题。

毕竟,受保护的成员本来就不应该被生成,毕竟就算生成了代码,也是错误的。

SlimeNull avatar Dec 14 '23 12:12 SlimeNull

建议改为配置

chexiongsheng avatar Dec 15 '23 03:12 chexiongsheng