Skip to content

Commit 00f4bbc

Browse files
committed
[AutoDiff] State explicit conditional conformances in DifferentiationUnittest.
This fixes verification of emitted swiftinterface files. ```console error: conditional conformance of type 'Tracked<T>' to protocol 'SignedNumeric' does not imply conformance to inherited protocol 'Numeric' extension Tracked : Swift.SignedNumeric where T : Swift.SignedNumeric, T == T.Magnitude { ^ ``` Resolves rdar://77869183.
1 parent fb293cb commit 00f4bbc

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

stdlib/private/DifferentiationUnittest/DifferentiationUnittest.swift.gyb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,7 @@ extension ${Self}: Equatable where T: Equatable {
196196
}
197197
}
198198

199-
extension ${Self}: SignedNumeric & Numeric
200-
where T: SignedNumeric, T == T.Magnitude {
199+
extension ${Self}: Numeric where T: Numeric {
201200
public typealias Magnitude = ${Self}<T.Magnitude>
202201

203202
public init?<U>(exactly source: U) where U: BinaryInteger {
@@ -217,6 +216,12 @@ where T: SignedNumeric, T == T.Magnitude {
217216
}
218217
}
219218

219+
extension ${Self}: SignedNumeric where T: SignedNumeric, T == T.Magnitude {
220+
public prefix static func - (operand: ${Self}) -> ${Self} {
221+
${Self}(-operand.value)
222+
}
223+
}
224+
220225
extension ${Self} where T: FloatingPoint {
221226
public static func / (lhs: ${Self}, rhs: ${Self}) -> ${Self} {
222227
return ${Self}(lhs.value / rhs.value)

0 commit comments

Comments
 (0)