Skip to content

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

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

ahoppen
Copy link
Member

@ahoppen ahoppen commented May 4, 2021

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 a review from xymus May 4, 2021 10:44
@ahoppen
Copy link
Member Author

ahoppen commented May 4, 2021

@swift-ci Please test

@ahoppen ahoppen merged commit 7462a62 into swiftlang:main May 4, 2021
@ahoppen ahoppen deleted the pr/dont-print-dollar-internal-labels branch May 4, 2021 16:34
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