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-4637] Add fix-it for removing '@escaping' from optional closure parameter #47214
Comments
Comment by Garric Nahapetian (JIRA) Thank you @belkadan for updating this SR. It's my fist so I'm just getting the hang of things. Any feedback/help is greatly appreciated 🙂 |
I'm not sure "by default" is the correct phrasing here, as I don't think there's any way to make them non-escaping. "Optional closures are already escaping" could be a different error message, or alternatively a note. But the fixit would be very helpful! garricn (JIRA User) ask if you have any questions |
Comment by Garric Nahapetian (JIRA) I certainly have/will have questions. 1) I plan to start working on it this weekend. I don't need to feel rushed, correct? Anyhoo, thank you and good night! 🙂 |
1) Correct. |
Comment by Garric Nahapetian (JIRA) @milseman Excellent feedback. Thank you! |
Comment by Kaden Wilkinson (JIRA) Error is currently pretty cryptic in Swift 4 ![](Screen Shot 2017-09-11 at 8.03.08 AM.png) |
Comment by Michael Critz (JIRA) #tryswift |
Comment by Garric Nahapetian (JIRA) I thought we already fixed this: #8947 I wonder what happened... |
Comment by Michael Critz (JIRA) garricn (JIRA User) I was able to reproduce the original bug. The note didn’t appear in the fixit UI. The work is mostly done. I’d like to add some minimal logic to the fix-it to be more informative and accurate. Basically, add the suggested text from the April 2017 comments. |
Comment by Garric Nahapetian (JIRA) Great! |
critz (JIRA User), are you still working on this? (I'm checking in on all the StarterBugs that haven't been touched in over a month; it's totally fine if you just haven't had time but still want to keep it.) |
Comment by Michael Critz (JIRA) @belkadan not actively. Feel free to bump me off this. |
Done. You're welcome to return to it if you get the time! |
Comment by Ivan Smetanin (JIRA) Fixed in #30746 |
Attachment: Download
Environment
Xcode 8.3.1, Swift 3.1
Additional Detail from JIRA
md5: ea3ce9103e3b95d06baa97059732e723
Issue Description:
As of SR-2444, optional closures as function parameters are already escaping
escaping by default. Currently, when adding the @escaping attribute to an optional closure parameter, the compiler throws the following error:Since this type is already escaping
escaping by default, it would be helpful to add / amend the error as follows:And add the following Fix-it:
The text was updated successfully, but these errors were encountered: