Skip to content

[AutoDiff] Serialize and print @derivative and @transpose accessor kind. #32839

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

Merged
merged 1 commit into from
Jul 12, 2020

Conversation

dan-zheng
Copy link
Contributor

Serialize and print the optional accessor kind in @derivative and @transpose attributes.

Example: @derivative(of: property.set) is now serialized and printed as @derivative(of: property.set) instead of @derivative(of: property).

Resolves TF-1293.

…r kind.

Serialize and print the optional accessor kind in `@derivative` and `@transpose`
attributes.

Resolves TF-1293.
@dan-zheng dan-zheng requested review from rxwei and ematejska July 11, 2020 18:29
Comment on lines +59 to +63
// Note: qualified name base types are not yet serialized and are not printed
// when round-tripping.

// CHECK: @derivative(of: instanceMethod, wrt: (self, x))
@derivative(of: instanceMethod, wrt: (self, x))
@derivative(of: S.instanceMethod, wrt: (self, x))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: qualified name base types are not yet serialized for @derivative or @transpose attributes.

Example: @derivative(of: S.instanceMethod) is serialized and subsequently printed as @derivative(of: instanceMethod).

This isn't yet an issue in practice, because @derivative and @transpose declarations are designed to be declared in the same type context as their referenced original declaration. We can tackle it if it becomes a problem.

@dan-zheng
Copy link
Contributor Author

@swift-ci Please smoke test

@dan-zheng dan-zheng merged commit bf47403 into swiftlang:master Jul 12, 2020
@dan-zheng dan-zheng deleted the TF-1293 branch July 12, 2020 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants