Skip to content

[ASTPrinter] Fix duplicate «mutating» modifiers when printing file interface #30011

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
Mar 18, 2020

Conversation

AnthonyLatsis
Copy link
Collaborator

@AnthonyLatsis AnthonyLatsis commented Feb 22, 2020

Resolves SR-12139.

I am still unable to sort out the expected behavior of PrintImplicitAttributes though. In particular, the if statement in printAttributes is narrowing down the set of attributes to print in a strangely selective manner (although printing implicit attributes implies printing more attributes than otherwise).

@slavapestov
Copy link
Contributor

@swift-ci Please smoke test

@benlangmuir
Copy link
Contributor

@slavapestov @brentdax is this ready to go? I don't understand the PrintImplicitAttributes part of this change, but the rest seems good to me.

@@ -1008,19 +1005,23 @@ void PrintAST::printAttributes(const Decl *D) {
// clients, or if it inherits superclass convenience initializers,
// then print those attributes specially.
if (auto CD = dyn_cast<ClassDecl>(D)) {
if (Options.PrintImplicitAttrs) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@benlangmuir This is all nested inside if (Options.PrintImplicitAttrs) up above, so I just eliminated the unnecessary scope.

@AnthonyLatsis
Copy link
Collaborator Author

AnthonyLatsis commented Mar 18, 2020

@benlangmuir I am not sure when we will hear from Slava, but since the change is approved, do you mind merging it for me? This better be fixed for 5.2.

@benlangmuir
Copy link
Contributor

Let's re-test since it's been so long.

@benlangmuir
Copy link
Contributor

@swift-ci Please smoke test

@AnthonyLatsis
Copy link
Collaborator Author

Thanks, Ben!

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.

3 participants