Skip to content

AST: Print the custom attributes attached to AttributedTypeRepr #63701

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

Conversation

tshortli
Copy link
Contributor

This ensures that global actor attributes are included when printing a TypeRepr representing a global actor bound function type.

Resolves rdar://105475701

This ensures that global actor attributes are included when printing a `TypeRepr` representing a global actor bound function type.

Resolves rdar://105475701
@tshortli tshortli requested review from DougGregor and removed request for xedin, slavapestov and hborla February 16, 2023 02:15
@@ -218,6 +218,15 @@ void AttributedTypeRepr::printAttrs(ASTPrinter &Printer,
Printer.printSimpleAttr("@autoclosure") << " ";
if (hasAttr(TAK_escaping))
Printer.printSimpleAttr("@escaping") << " ";

for (auto customAttr : Attrs.getCustomAttrs()) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wasn't sure whether it might make sense to try to specifically find the global actor attribute here and print it individually, rather than all of the custom attributes all at once. In the future when there are multiple kinds of attributes we might want to print each possible custom attribute kind in a stable order.

@tshortli
Copy link
Contributor Author

@swift-ci please test

Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

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

LGTM. @hborla or I will need to follow this up with some suppression rules for macros, because macros are custom attributes that aren't rendered.

@tshortli tshortli merged commit e7c24bd into swiftlang:main Feb 16, 2023
@tshortli tshortli deleted the main-actor-missing-on-closure-param branch February 16, 2023 07:48
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