Skip to content

Commit 73d43cf

Browse files
committed
Put back subscript.
1 parent b95a187 commit 73d43cf

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

stdlib/public/core/SIMDVectorTypes.swift.gyb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ public struct SIMD${n}<Scalar>: SIMD where Scalar: SIMDScalar {
4545
}
4646

4747
/// Accesses the scalar at the specified position.
48-
@differentiable(vjp: _vjpSubscript
49-
where Scalar : EuclideanDifferentiable & BinaryFloatingPoint,
50-
Scalar.TangentVector : BinaryFloatingPoint)
5148
public subscript(index: Int) -> Scalar {
5249
@_transparent get {
5350
_precondition(indices.contains(index))
@@ -206,8 +203,9 @@ extension SIMD${n}
206203
where Scalar : EuclideanDifferentiable & BinaryFloatingPoint,
207204
Scalar.TangentVector : BinaryFloatingPoint {
208205
@usableFromInline
206+
@derivative(of: subscript(index:))
209207
internal func _vjpSubscript(index: Int)
210-
-> (Scalar, (Scalar.TangentVector) -> TangentVector) {
208+
-> (value: Scalar, pullback: (Scalar.TangentVector) -> TangentVector) {
211209
return (self[index], { v in
212210
var zeros = Self.zero
213211
zeros[index] = Scalar(v)

0 commit comments

Comments
 (0)