Skip to content

[5.5][AST] Don’t print internal function labels if they start with '$' #37239

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

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented May 4, 2021

Cherry-picks #37238 to 5.5


We might infer internal function labels as $0 from a closure with which a variable is initialised. But we don’t want to print the function signature as (_ $0: Int) -> Int because $0 is not a valid variable name to declare.

So, in the case described above, only print the type.

Fixes rdar://77462547

We might infer internal function labels as `$0` from a closure with which a variable is initialised. But we don’t want to print the function signature as `(_ $0: Int) -> Int` because `$0` is not a valid variable name to declare.

So, in the case described above, only print the type.

Fixes rdar://77462547
@ahoppen ahoppen requested review from akyrtzi and xymus May 4, 2021 10:46
@ahoppen ahoppen requested a review from a team as a code owner May 4, 2021 10:46
@ahoppen
Copy link
Member Author

ahoppen commented May 4, 2021

@swift-ci Please test

@ahoppen ahoppen changed the title [AST] Don’t print internal function labels if they start with '$' [5.5][AST] Don’t print internal function labels if they start with '$' May 4, 2021
@ahoppen ahoppen added the r5.5 label May 4, 2021
@swift-ci
Copy link
Contributor

swift-ci commented May 4, 2021

Build failed
Swift Test OS X Platform
Git Sha - 229275a

@xymus
Copy link
Contributor

xymus commented May 4, 2021

This looks good, thank you!

@swift-ci Please smoke test macOS

@ahoppen
Copy link
Member Author

ahoppen commented May 5, 2021

@swift-ci Please test macOS

@ahoppen
Copy link
Member Author

ahoppen commented May 5, 2021

@swift-ci Please test Windows

@ahoppen ahoppen merged commit a6346f8 into swiftlang:release/5.5 May 6, 2021
@ahoppen ahoppen deleted the pr-5.5/dont-print-dollar-internal-labels branch May 6, 2021 16:35
@AnthonyLatsis AnthonyLatsis added 🍒 release cherry pick Flag: Release branch cherry picks swift 5.5 labels Jan 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks swift 5.5
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants