-
Notifications
You must be signed in to change notification settings - Fork 408
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
Conversation
@swift-ci Please test macOS |
c178ed8
to
3771d3d
Compare
@swift-ci Please test |
@swift-ci Please test Windows |
3771d3d
to
0f06c9f
Compare
@swift-ci Please test |
@swift-ci Please test Windows |
woohoo! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice 😍
/// 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// 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. |
695f08f
to
095428d
Compare
@swift-ci Please test |
095428d
to
bb01f02
Compare
@swift-ci Please test |
`DeclName` was only used for attributes and has the same structure as `IdentifierExprSyntax`. Let’s use `IdentifierExprSyntax` instead.
…hPropertyComponentSyntax`
bb01f02
to
8d40a59
Compare
swiftlang/swift-format#577 @swift-ci Please test Windows |
So, wait, what's the difference between |
|
swiftlang/swift-format#577 @swift-ci Please test macOS |
swiftlang/swift-format#577 @swift-ci Please test Linux |
DeclName
was essentially a copy ofIdentifierExpr
that was just used for attributes. Kill it and replace it withIdentifierExpr
.IdentifierExpr
inImplementAttributeArgumentsSytnax