Skip to content

Commit a694907

Browse files
committed
Test: Add a missing test case to derivative_symbols.swift.
1 parent cd1d1f8 commit a694907

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/AutoDiff/TBD/derivative_symbols.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,16 @@ public struct Struct: Differentiable {
8080
}
8181
}
8282

83+
extension Struct {
84+
// Test a derivative declared in an extension.
85+
@derivative(of: init(_:))
86+
public static func _vjpInit(_ value: Float)
87+
-> (value: Struct, pullback: (TangentVector) -> (Float.TangentVector)) {
88+
fatalError()
89+
}
90+
}
91+
92+
8393
extension Array where Element == Struct {
8494
@differentiable(reverse)
8595
public func sum() -> Float {

0 commit comments

Comments
 (0)