-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Demangle to metadata] Support simple extension contexts. #16533
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
[Demangle to metadata] Support simple extension contexts. #16533
Conversation
Support demangling for types nested within some simple extension contexts. Still does not support nested types within constrained extensions that involve same-type constraints among generic parameters, nor deeply-nested types in extensions. However, it fixes rdar://problem/40071688.
@swift-ci please smoke test and merge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! @aschwaighofer would be happy :)
@DougGregor Thank you! |
_typeByMangledName("4main4SG11VA2A2P1RzlE016InnerTConformsToC0VA2A2P3Rd__rlE018InnermostUConformsfG0VyAA08ConformsfC0V_AA0jf5P2AndG0V_AA0jF3P4aVG")!) | ||
|
||
// Failure case: Dictionary's outer `Key: Hashable` constraint not sastified | ||
// TODO: expectNil(_typeByMangledName("s10DictionaryV4mainE5InnerVyAC12ConformsToP1VSi_AC12ConformsToP1VG")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for picking this up, Doug! Did you happen to test that this case gets rejected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this one ended up crashing in the runtime (!).
// Failure case: SG11's inner `U: P2` constraint not satisfied | ||
expectNil(_typeByMangledName("4main4SG11VA2A2P1RzlE016InnerTConformsToC0VyAA08ConformsfC0V_AHGMa")) | ||
|
||
// TODO: Failure case: InnermostUConformsToP3's 'U: P3' constraint not satisfied |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…or this case (which I didn't get around for forming the mangled name for, sorry)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't conjure up the mangled name to test it either (sorry).
Support demangling for types nested within some simple extension contexts.
Still does not support nested types within constrained extensions that
involve same-type constraints among generic parameters, nor
deeply-nested types in extensions. However, it fixes
rdar://problem/40071688.
This an updated version of #16287.