Skip to content

Conversation

arthurcro
Copy link
Contributor

Motivation

Fixes #210.

Modifications

With this PR. we are removing the explicit Equatable conformance when a type already conforms to Hashable
in generated code.

Result

Generated types now conforms explicitly to Hashable but not to Equatable.

- public struct Generated: Equatable, Hashable {
  }
+ public sutrct Generated: Hashable {
 }

Test Plan

I have updated the reference ressources used by tests to check generated code.

@arthurcro arthurcro changed the title Remove redundant Equatable conformances in code generation Remove redundant explicity Equatable conformances in code generation Aug 20, 2023
@arthurcro arthurcro changed the title Remove redundant explicity Equatable conformances in code generation Remove redundant Equatable conformances in code generation Aug 20, 2023
@czechboy0
Copy link
Contributor

This looks great, @arthurcro . Could you also audit the runtime library please? 🙏

@czechboy0
Copy link
Contributor

@swift-server-bot add to allowlist

@arthurcro
Copy link
Contributor Author

@czechboy0 Yes, definitely! I actually have the changes ready for the runtime library on a local branch! I'll open a pull request for it today! 🙂

@arthurcro arthurcro marked this pull request as ready for review August 21, 2023 07:14
@czechboy0 czechboy0 merged commit 2840e08 into apple:main Aug 21, 2023
@czechboy0 czechboy0 added the semver/none No version bump required. label Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver/none No version bump required.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Avoid the explicit Equatable conformance if already conforming to Hashable

2 participants