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

[SR-13983] AdditiveArithmetic misleading text #56378

Closed
dabrahams opened this issue Dec 22, 2020 · 2 comments
Closed

[SR-13983] AdditiveArithmetic misleading text #56378

dabrahams opened this issue Dec 22, 2020 · 2 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. conformances Feature → protocol: protocol conformances documentation standard library Area: Standard library umbrella

Comments

@dabrahams
Copy link
Collaborator

Previous ID SR-13983
Radar rdar://problem/72592923
Original Reporter @dabrahams
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Standard Library
Labels Bug, Documentation, ProtocolConformance
Assignee None
Priority Medium

md5: c04775d9a8673c0e65501d08f090f9cb

Issue Description:

Conforming to the AdditiveArithmetic Protocol

To add AdditiveArithmetic protocol conformance to your own custom type, implement the required operators, and provide a static zero property using a type that can represent the magnitude of any value of your custom type.

(emphasis mine). Not sure what the emphasized part is supposed to mean, but it certainly implies that the zero property has an associated type that can be different from Self, which could in fact be very useful but isn't supported. If we're gonna say something about zero here without changing the protocol it should be that it represents additive identity.

@typesanitizer
Copy link

@swift-ci create

@swift-ci
Copy link
Collaborator

Comment by Alex Martini (JIRA)

Fixed in 0b9ae84.

#36709

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. conformances Feature → protocol: protocol conformances documentation standard library Area: Standard library umbrella
Projects
None yet
Development

No branches or pull requests

3 participants