-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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-1016] #selector broken for no-argument initializers and functions #43628
Comments
You can work around this by using |
cc @DougGregor |
Comment by Marc Knaup (JIRA) Still not working in swift-DEVELOPMENT-SNAPSHOT-2017-09-26-a-osx but by now with a different error message: import UIKit
#selector(UIViewController.init())
// error: argument of '#selector' does not refer to an '@objc' method, property, or initializer Since |
Given that this would be a change in the language semantics, it should go through swift-evolution. |
Comment by Marc Knaup (JIRA) What would be a change in semantics here?
|
Well, it's making some ill-formed code well-formed, and means that the expression UIViewController.init() has a different meaning within #selector than it does outside of #selector. |
Comment by Marc Knaup (JIRA) I understand. But why is that a problem?
The way I understand This is inconsistent and confusing. To sum it up - the actual issue is still the same: |
Environment
Xcode 7.3 / Swift 2.2
Additional Detail from JIRA
md5: 5b9028031618d217e4b82fcbe4d30fd1
is duplicated by:
Issue Description:
#selector(init())
does not work:And using
#selector(init)
as a workaround does not work if there is more than one initializer:The bug affects regular non-argument functions as well.
The text was updated successfully, but these errors were encountered: