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-6803] Accept same-file extensions for automatic synthesis of Equatable/Hashable #49352
Comments
@itaiferber, I know we had trouble doing this with Codable, but would your same work at least handle Equatable/Hashable? Maybe we can get that part in. cc also @allevato |
@belkadan The issue wasn't Codable-specific — we'd run into the same problems with Equatable/Hashable. The problem is that struct Foo { ... }
extension Foo : Equatable {} hits code paths in the compiler in a different order from extension Foo : Equatable {}
struct Foo { ... } IIRC, the second form compiles but the first does not. We should try to figure out a way around this if we can; let's continue via email. I'll be back in the office tomorrow. |
Are there plans to implement this for 4.1? I need to know whether I can count on these conditional conformances to be automatically synthesized. |
It's unlikely, sorry. |
So the 2 biggest features of Swift 4.1 won't actually work together 🙁 |
@swift-ci create |
Environment
Swift version 4.1-dev (LLVM ef53654946, Clang f7df1e5a04, Swift 831b78c)
Additional Detail from JIRA
md5: 7ee094bf8b76b4c699a3948b5de96775
relates to:
Issue Description:
Conditional conformance doesn't work well with automatic synthesis of Equatable/Hashable because the only way to define conformance is in extensions, but automatic synthesis isn't allowed there.
Consider:
Expected result:
Code compiles, and Equatable is synthesized
Actual result:
See https://twitter.com/dgregor79/status/954524765003292672.
The text was updated successfully, but these errors were encountered: