- Notifications
You must be signed in to change notification settings - Fork 10.5k
/
Copy pathdifferentiable_features_disabled.swift
23 lines (18 loc) · 967 Bytes
/
differentiable_features_disabled.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// RUN: %target-swift-frontend -typecheck -verify %s
// expected-error @+1 {{'@differentiable' used without importing module '_Differentiation'}}
let _:@differentiable(reverse)(Float)->Float
// expected-error @+2 {{'@differentiable' used without importing module '_Differentiation'}}
// expected-error @+1 {{'@noDerivative' used without importing module '_Differentiation'}}
let _:@differentiable(reverse)(Float,@noDerivativeFloat)->Float
// expected-error @+1 {{'@noDerivative' used without importing module '_Differentiation'}}
let _:(Float,@noDerivativeFloat)->Float
// expected-error @+1 {{'@noDerivative' used without importing module '_Differentiation'}}
let _:@noDerivativeFloat
func id(_ x:Float)->Float{
return x
}
// expected-error @+1 {{@derivative attribute used without importing module '_Differentiation'}}
@derivative(of: id)
func jvpId(x:Float)->(value:Float, differential:(Float)->(Float)){
return(x,{ $0 })
}