You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Sema] Differentiable conformance derivation for class types. (#25914)
`Differentiable` derived conformances now supports class types.
Synthesis works just like for struct types, except `TangentVector = Self`
is never synthesized even if `Self` conforms to `AdditiveArithmetic`.
Class differentiation support requires further differentiation
transform changes.
Resolves TF-630.
// CHECK-AST-LABEL: final internal class AdditiveArithmeticClass<T> : AdditiveArithmetic, Differentiable where T : AdditiveArithmetic, T : Differentiable {
// expected-error @+1 {{'@noDerivative' is only allowed on stored properties in structure types that declare a conformance to 'Differentiable'}}
3
+
// expected-error @+1 {{'@noDerivative' is only allowed on stored properties in structure or class types that declare a conformance to 'Differentiable'}}
4
4
@noDerivativevarflag:Bool
5
5
6
6
structFoo{
7
-
// expected-error @+1 {{'@noDerivative' is only allowed on stored properties in structure types that declare a conformance to 'Differentiable'}}
7
+
// expected-error @+1 {{'@noDerivative' is only allowed on stored properties in structure or class types that declare a conformance to 'Differentiable'}}
0 commit comments