Skip to content
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

ASTPrinter: Turn on explicit any printing for everything and remove the option to disable it #65731

Merged
merged 1 commit into from
May 16, 2023

Conversation

AnthonyLatsis
Copy link
Collaborator

No description provided.

@slavapestov
Copy link
Contributor

@swift-ci Please test

@AnthonyLatsis
Copy link
Collaborator Author

Heh, missed some after all.

@ahoppen
Copy link
Contributor

ahoppen commented May 8, 2023

Do we want to flip the switch now? My impression (and it doesn’t have to be correct) has been that we want to flip it when Swift 6 comes around and any actually starts being required. At least for code completion results, printing the any makes the results quite a bit more verbose.

@hborla
Copy link
Member

hborla commented May 8, 2023

Do we want to flip the switch now? My impression (and it doesn’t have to be correct) has been that we want to flip it when Swift 6 comes around and any actually starts being required.

My intention was to only flip the switch for requiring it in source code in Swift 6. Diagnostics, Swift interfaces, and many other things already print the any keyword, even when it's not written in source. The only reason I added the ASTPrinter flag upfront was because there was a lot to change, not because I deliberately wanted to suppress any printing before Swift 6. I also think that printing any in these places encourages folks to start writing any now.

At least for code completion results, printing the any makes the results quite a bit more verbose.

I've always found it misleading that code completion displays existential parameters and generic parameters in the same way. But in any case, I think the desired behavior of code completion is independent from which language mode any becomes required in.

test/IDE/complete_member_type.swift Show resolved Hide resolved
test/IDE/complete_operators.swift Show resolved Hide resolved
test/SourceKit/CursorInfo/cursor_some_type.swift Outdated Show resolved Hide resolved
test/attr/attr_objc.swift Show resolved Hide resolved
Copy link
Contributor

@ahoppen ahoppen left a comment

Choose a reason for hiding this comment

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

LGTM for all the changes in test/IDE. I didn’t review the other changes.

@AnthonyLatsis
Copy link
Collaborator Author

@swift-ci please smoke test

@AnthonyLatsis AnthonyLatsis force-pushed the always-print-any branch 2 times, most recently from f8f0de7 to 0141b7f Compare May 12, 2023 03:30
@AnthonyLatsis
Copy link
Collaborator Author

@swift-ci Please test

@AnthonyLatsis
Copy link
Collaborator Author

@swift-ci Please test

@AnthonyLatsis
Copy link
Collaborator Author

@swift-ci please smoke test macOS

@AnthonyLatsis AnthonyLatsis merged commit 3f62931 into swiftlang:main May 16, 2023
@AnthonyLatsis AnthonyLatsis deleted the always-print-any branch May 16, 2023 00:27
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.

None yet

5 participants