Skip to content

[5.1] [ModuleInterface] Explicitly print implied Hashable et al on enums #25709

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

Merged

Conversation

jrose-apple
Copy link
Contributor

Cherry-pick of #25662 and #25650 to the 5.1 branch. Reviewed by @harlanhaskins.

rdar://problem/50100142

…ang#25662)

Previously the module interface printing would scrape the
AvailableAttrs from the containing decl in order to print synthesized
extensions for conformances that wouldn't otherwise be printed...but
that missed the case where a containing lexical scope had the
availability attributes instead. Now it walks up the chain of parent
DeclContexts and collects the most specific AvailableAttr for each
platform.

This /still/ isn't formally correct because it doesn't merge
availability for one platform (if something inside is deprecated
unconditionally but outside has an "introduced" version), but it's
going to match the vast majority of code out there.

Pre-requisite for rdar://problem/50100142

(cherry picked from commit 15bcd23)
…wiftlang#25650)

Enums have a handful of conformances that are implied by their
structure: Equatable and Hashable if they have no payloads, and
RawRepresentable if they have a raw value. In the spirit of making
implicit things explicit, these should be printed in the module
interface.

rdar://problem/50100142
(cherry picked from commit b668017)
@jrose-apple
Copy link
Contributor Author

@swift-ci Please test

@jrose-apple jrose-apple merged commit b04cff1 into swiftlang:swift-5.1-branch Jun 24, 2019
@jrose-apple jrose-apple deleted the 5.1-imply-in-the-sky branch June 24, 2019 19:56
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.

1 participant