Skip to content
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

Incorrect Term Used in Adopting a Protocol Using a Synthesized Implementation #268

Open
tadbyt opened this issue Feb 5, 2024 · 0 comments

Comments

@tadbyt
Copy link
Contributor

tadbyt commented Feb 5, 2024

Location

https://docs.swift.org/swift-book/documentation/the-swift-programming-language/protocols/#Adopting-a-Protocol-Using-a-Synthesized-Implementation

Description

There are several references to associated type in the Adopting a Protocol Using a Synthesized Implementation subsection. An enumeration doesn't have an associated type. Rather, some or all of its enumeration cases may have associated values.

Correction

Replace each instance of associated type with associated value. In some cases, the wording should be adjusted to indicate the types of the associated values for clarity.

Specifically, the last two bullets in the first list should become:

  • Enumerations that have only associated values whose types conform to the Equatable protocol
  • Enumerations that have no associated values

The last two bullets in the second list should become:

  • Enumerations that have only associated values whose types conform to the Hashable protocol
  • Enumerations that have no associated types

Finally, the second sentence in the seventh paragraph should be reworded to:

If the enumeration has associated values, their types must all conform to the Comparable protocol.

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

No branches or pull requests

1 participant