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
[SR-12206] Symbol collision when multiple enum cases with same base name have default arguments #54632
Comments
Does changing the mangling have ABI implications? (Also see discussion in SR-10077) |
@swift-ci create |
@theblixguy I don't think the enum case accessors are ever generated as public symbols. Am I right about that @slavapestov? |
When resilience is enabled, the enum case mangling is used to emit a public symbol with the case index. So yes, unfortunately we'll need to hack in compatibility somehow. |
Well, the good news is that pattern matching cases with the same name seems to be generally broken, so breaking the ABI in cases where there are multiple cases with the same base name might not be a problem in practice: https://bugs.swift.org/browse/SR-12229 |
Okay. I suppose the For compatibility, would a build flag be reasonable? and if so, it would need to be added implicitly by default I suppose so everything builds with it? |
Yes, we need to mangle argument labels too. It appears that the mangler is only mangling the payload type and not the labels, which is incorrect. Unfortunately this will break existing code, so you have to continue to emit the old symbols and alias them in the resilience case. |
To preserve the ABI for the case index symbols, maybe we could mangle them using the base name and payload type, but use the full name for other non-ABI symbols related to the case? |
Additional Detail from JIRA
md5: 536212832ea3b9588bb83c4037b9f167
Parent-Task:
Issue Description:
This:
crashes because we mangle the same symbol name for both default argument generators:
The text was updated successfully, but these errors were encountered: