Skip to content

Commit da6c765

Browse files
committed
Constrain AlgebraicField to required Magnitude:AlgebraicField
This is formally a source-breaking change. However it is expected to not be source-breaking in practice, because any conforming type either has a real magnitude (in the case of real or complex types), which would necessarily have to support all the AF operations to implement the type, or is perhaps a finite field with a bogus stand-in Magnitude.
1 parent 6356eb3 commit da6c765

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/RealModule/AlgebraicField.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
/// See also `Real`, `SignedNumeric`, `Numeric` and `AdditiveArithmetic`.
4141
///
4242
/// [field]: https://en.wikipedia.org/wiki/Field_(mathematics)
43-
public protocol AlgebraicField: SignedNumeric {
43+
public protocol AlgebraicField: SignedNumeric where Magnitude: AlgebraicField {
4444

4545
/// Replaces a with the (approximate) quotient `a/b`.
4646
static func /=(a: inout Self, b: Self)

0 commit comments

Comments
 (0)