Files
swift-mirror/test/AutoDiff/compiler_crashers_fixed/rdar71191415-nested-differentiation-of-extension-method-optimized.swift
Richard Wei 517bcc4493 [AutoDiff] Fix differentiation transform crashers in library evolution mode. (#34704)
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.
2020-11-12 13:30:56 -08:00

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)
}
}