swift
9165198d - [AutoDiff] Tweak `Differentiable` associated struct synthesis. (#22030)

Commit
6 years ago
[AutoDiff] Tweak `Differentiable` associated struct synthesis. (#22030) Relax condition for synthesizing `AllDifferentiableVariables` struct and letting `TangentVector` and `CotangentVector` alias it. Previously, the condition was "all stored properties have `Self = TangentVector = CotangentVector = AllDifferentiableVariables`". This is overly restrictive and doesn't support the case where properties have all associated types equal to one another but `Self != AllDifferentiables`. This occurs when the stored property type: - Has any `@noDerivative` properties. - Doesn't itself conform to `AdditiveArithmetic`. The precise correct condition is "all stored properties have `TangentVector = CotangentVector = AllDifferentiableVariables`".
Author
Parents
Loading