You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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:
The last two bullets in the second list should become:
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.
The text was updated successfully, but these errors were encountered: