Define Complex.zeroTangentVectorInitializer.

The `Differentiable.zeroTangentVectorInitializer` protocol requirement is a
closure producing a zero tangent vector, capturing minimal information from
`self`.

Fixes the `Complex: Differentiable` conformance for master toolchains.
This commit is contained in:
Dan Zheng committed 2020-06-08 19:53:43 -07:00
1 parent 593946d4aa
commit 86f0b33c65
2 files changed
+9

No files matched your search

@@ -15,6 +15,11 @@ import _Differentiation
extension Complex: Differentiable
where RealType: Differentiable, RealType.TangentVector == RealType {
public typealias TangentVector = Self
@inlinable
public var zeroTangentVectorInitializer: () -> Self {
{ Complex.zero }
}
}
extension Complex