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

Use IdentifierExpr in a couple more places instead of DeclNameArguments #1950

Merged
merged 6 commits into from
Aug 1, 2023

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Jul 26, 2023

  • DeclName was essentially a copy of IdentifierExpr that was just used for attributes. Kill it and replace it with IdentifierExpr.
  • Also use IdentifierExpr in ImplementAttributeArgumentsSytnax

@ahoppen ahoppen marked this pull request as ready for review July 26, 2023 23:41
@ahoppen ahoppen requested a review from bnbarham July 26, 2023 23:41
@ahoppen
Copy link
Member Author

ahoppen commented Jul 26, 2023

@swift-ci Please test macOS

@ahoppen
Copy link
Member Author

ahoppen commented Jul 27, 2023

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented Jul 27, 2023

@swift-ci Please test Windows

@ahoppen
Copy link
Member Author

ahoppen commented Jul 28, 2023

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented Jul 28, 2023

@swift-ci Please test Windows

@grynspan
Copy link
Contributor

woohoo!

Copy link
Contributor

@bnbarham bnbarham left a comment

Choose a reason for hiding this comment

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

Nice 😍

Comment on lines 17 to 31
/// A member access can specify argument labels to reference an unapplied of
/// a specific overload based on its argument labels. For example you can have
/// ```swift
/// struct Person {
/// func consume(drink: Drink) {}
/// func consume(food: Food) {}
/// }
/// ```
///
/// Then you can use `person.consume(drink:)` to explicitly reference the
/// consume function that takes a drink.
///
/// In most cases, this is not needed and this initializier creates a member
/// access that does not contain any argument names like `(drink:)` in the
/// example above.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// A member access can specify argument labels to reference an unapplied of
/// a specific overload based on its argument labels. For example you can have
/// ```swift
/// struct Person {
/// func consume(drink: Drink) {}
/// func consume(food: Food) {}
/// }
/// ```
///
/// Then you can use `person.consume(drink:)` to explicitly reference the
/// consume function that takes a drink.
///
/// In most cases, this is not needed and this initializier creates a member
/// access that does not contain any argument names like `(drink:)` in the
/// example above.
/// A member access can specify function argument labels, which is required when the name would be ambiguous otherwise. For example, given multiple overloads
/// ```swift
/// struct Person {
/// func consume(drink: Drink) {}
/// func consume(food: Food) {}
/// }
/// ```
///
/// `consume(drink:)` is required to explicitly reference the consume function that takes a drink.
///
/// Given how common it is to not need the argument names, this initializer is provided as a convenience to avoid having to create a ``DeclReferenceExpr`` for the member name.

@ahoppen ahoppen force-pushed the ahoppen/identifierexpr branch 2 times, most recently from 695f08f to 095428d Compare August 1, 2023 01:24
@ahoppen
Copy link
Member Author

ahoppen commented Aug 1, 2023

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented Aug 1, 2023

swiftlang/swift-format#577

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented Aug 1, 2023

@ahoppen
Copy link
Member Author

ahoppen commented Aug 1, 2023

@grynspan
Copy link
Contributor

grynspan commented Aug 1, 2023

So, wait, what's the difference between IdentifierExprSyntax and DeclReferenceExprSyntax now?

@ahoppen
Copy link
Member Author

ahoppen commented Aug 1, 2023

IdentifierExprSyntax has been renamed to DeclReferenceExprSyntax.

@ahoppen
Copy link
Member Author

ahoppen commented Aug 1, 2023

@ahoppen
Copy link
Member Author

ahoppen commented Aug 1, 2023

@ahoppen ahoppen merged commit ea619f4 into swiftlang:main Aug 1, 2023
@ahoppen ahoppen deleted the ahoppen/identifierexpr branch August 1, 2023 17:57
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