Skip to content

Support for https://github.com/apple/swift/pull/66540: @_silgen_name on globals, @_silgen_name(raw: ...) #1850

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
Jun 29, 2023

Conversation

kubamracek
Copy link
Contributor

No description provided.

Copy link
Member

@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.

@_silgen_name can only be applied to types, right? If no disambiguation is necessary to decide whether the parentheses in eg. @_silgen_name () -> Void are attribute arguments or part of the closure type, I think you should be able to just remove all special handling for @_silgen_name and we’ll parse it like a user-defined attribute. ASTGen (which is still to be written) will then extract the arguments from the AttributeSyntax.

I.e. I think you can just delete all the code that you wrote in this PR and additionally remove _silgen_name from Keyword.swift because it will no longer used.

@kubamracek
Copy link
Contributor Author

kubamracek commented Jun 28, 2023

@_silgen_name can only be applied to types, right?

No, it's the opposite, it only applies to function and (newly) global variable declarations. It never goes on a type.

I think you can just delete all the code that you wrote in this PR and additionally remove _silgen_name from Keyword.swift because it will no longer used.

Let me try that!

@kubamracek kubamracek force-pushed the mracek/silgen-name-for-globals branch from 24af12b to 919ef62 Compare June 28, 2023 15:29
@kubamracek
Copy link
Contributor Author

That works, thanks!

@kubamracek
Copy link
Contributor Author

@swift-ci please test

@kubamracek
Copy link
Contributor Author

@swift-ci please test Windows platform

@kubamracek kubamracek merged commit 582c259 into main Jun 29, 2023
@kubamracek kubamracek deleted the mracek/silgen-name-for-globals branch June 29, 2023 15:36
@ahoppen
Copy link
Member

ahoppen commented Jul 6, 2023

No, it's the opposite, it only applies to function and (newly) global variable declarations. It never goes on a type.

Oh, sorry, in my original comment I meant to say cannot instead of can.

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