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

[SR-11179] #selector format is inconsistent #53576

Closed
swift-ci opened this issue Jul 22, 2019 · 2 comments
Closed

[SR-11179] #selector format is inconsistent #53576

swift-ci opened this issue Jul 22, 2019 · 2 comments
Labels
compiler The Swift compiler in itself improvement

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-11179
Radar None
Original Reporter ColinRoache (JIRA User)
Type Improvement
Status Resolved
Resolution Duplicate
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Improvement
Assignee None
Priority Medium

md5: b3aacfb51c42266e288c85da13eb4049

duplicates:

  • SR-1016 #selector broken for no-argument initializers and functions

Issue Description:

Currently, using #selector requires parenthesis when referencing functions and methods with arguments, but disallows parentheses when referencing those without arguments.

I recommend that a set of empty parentheses be required for selecting functions and methods which do not have arguments as to be similar to the syntax of defining a function or method without arguments.

@belkadan
Copy link
Contributor

The reason it's the way it is is because () would normally call the method, but you're not the first to suggest that in #selector that distinction isn't useful.

@swift-ci
Copy link
Collaborator Author

Comment by Colin Roache (JIRA)

@belkadan Gotcha; makes sense to me!

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler The Swift compiler in itself improvement
Projects
None yet
Development

No branches or pull requests

2 participants