-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Docs] [AutoDiff] Add default derivative subsection and fix minor issues. #28756
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Though I'd recommend waiting for @marcrasi to review also.
Co-Authored-By: Bart Chrzaszcz <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a good solution to me.
I have one question. What happens if a user defines a @derivative
of a @differentiable(default)
method?
Co-Authored-By: Bart Chrzaszcz <[email protected]>
It seems to me that should be rejected: |
I think this should be banned if it’s in the same module. Cross module should be allowed for flexibility, but can be banned in the initial proposal. |
@swift-ci please smoke test and merge |
This:
Made me think about whether there would be any problems with dynamic lookup of functions, but as far as I can tell there aren't any weird cases. |
That should be orthogonal, as statically the only thing involved is |
.withoutDerivative()
->withoutDerivative(at:)