Skip to content

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 ematejska and rxwei 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