Skip to content

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

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
merged 1 commit into from
Jun 24, 2019

Conversation

jrose-apple
Copy link
Contributor

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

@jrose-apple
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 4dbc3dd22ad80bad9f80150800b78991ad06450e

@jrose-apple
Copy link
Contributor Author

Hm, I thought I got the availability stuff in there. I'll check again.

@jrose-apple
Copy link
Contributor Author

…bold of me to assume the availability stuff that was there already worked.

@slavapestov
Copy link
Contributor

This is a good argument in favor of always reconstructing the inheritance clause from local conformances and the superclass, instead of preserving what the user wrote :)

@jrose-apple
Copy link
Contributor Author

This is a good argument in favor of always reconstructing the inheritance clause from local conformances and the superclass, instead of preserving what the user wrote :)

…I'm not sure why?

@slavapestov
Copy link
Contributor

@jrose-apple You would not have encountered this bug if we printed the 'single point of truth' as the inheritance clause instead of just printing what the user wrote (however there might have been other bugs).

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
@jrose-apple
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 4dbc3dd22ad80bad9f80150800b78991ad06450e

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 4dbc3dd22ad80bad9f80150800b78991ad06450e

@jrose-apple
Copy link
Contributor Author

@swift-ci Please test Linux

@jrose-apple jrose-apple merged commit b668017 into swiftlang:master Jun 24, 2019
@jrose-apple jrose-apple deleted the imply-in-the-sky branch June 24, 2019 17:36
jrose-apple added a commit to jrose-apple/swift that referenced this pull request Jun 24, 2019
…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)
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.

5 participants