Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sak9188
Copy link

@sak9188 sak9188 commented May 14, 2022

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

@tencent-adm
Copy link

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.

@sak9188
Copy link
Author

sak9188 commented May 14, 2022

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

@chexiongsheng
Copy link
Collaborator

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

@SlimeNull
Copy link
Contributor

SlimeNull commented Dec 14, 2023

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

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

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

@chexiongsheng
Copy link
Collaborator

chexiongsheng commented Dec 15, 2023

建议改为配置

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants