Skip to content

Commit 16f45ea

Browse files
authored
Merge pull request #38185 from rxwei/77869183
[AutoDiff] State explicit conditional conformances in DifferentiationUnittest.
2 parents b39299e + 00f4bbc commit 16f45ea

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)