apollographql / apollographql/apollo-tooling
[Swift] Generated code has unnecessary == definitions
- Dominant language
- TypeScript
- Stars
- 3k
- Forks
- 460
- PR merge metrics
- No merged PRs in 30d
Description
The generated Swift code includes definitions of `==` for each type as part of `Equatable` conformance (introduced in #216).
As of Swift 4.1, these explicit definitions are no longer necessary as the compiler will synthesize them for us. We're already relying on using Swift 4.1 or later for `Hashable` conformance so relying on it for `Equatable` conformance is safe as well. Removing the generated `==` operators will shrink the code size, which seems like a win.
Contributor guide
Research direction
Start by locating the Swift code-generation entry point and the template or logic that emits explicit `==` operators for `Equatable` types. Compare generated output before and after the change, and verify that generated Swift still relies on Swift 4.1 synthesis while omitting those definitions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift, typescript
- Domain
- tooling
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100