mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
AD-generated data structures (linear map structs and branching trace enums) do not need to be resilient data structures. These decls ade missing a `@frozen` attribute. Resolves rdar://71319547.
34 lines
475 B
Swift
34 lines
475 B
Swift
// RUN: %target-build-swift -O %s
|
|
|
|
// rdar://71191415
|
|
|
|
import _Differentiation
|
|
|
|
protocol P {
|
|
@differentiable
|
|
func req(_ input: Float) -> Float
|
|
}
|
|
|
|
extension P {
|
|
@differentiable
|
|
func foo(_ input: Float) -> Float {
|
|
return req(input)
|
|
}
|
|
}
|
|
|
|
struct Dummy: P {
|
|
@differentiable
|
|
func req(_ input: Float) -> Float {
|
|
input
|
|
}
|
|
}
|
|
|
|
struct DummyComposition: P {
|
|
var layer = Dummy()
|
|
|
|
@differentiable
|
|
func req(_ input: Float) -> Float {
|
|
layer.foo(input)
|
|
}
|
|
}
|