-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Parse] Error if closure has an unnamed parameter #70065
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
[Parse] Error if closure has an unnamed parameter #70065
Conversation
We accepted unnamed closure parameters if the type was an array literal, dictionary literal, tuple or function (because the `[` or `(` starting the type was sufficient to disambiguate the type from the parameter’s name). This was never an accepted syntax and we should disallow it.
@swift-ci Please smoke test |
@swift-ci Please test source compatibility |
I suggested that Alex go ahead and make this an error as long as the source compatibility test turns up green. This diagnostic has been staged in as a warning for a long time, and the last known adoption of this invalid syntax, which prompted dd1b157, has since been changed. I think that if we see any fallout from this change, we should use |
…break Record #70065 in the changelog
We accepted unnamed closure parameters if the type was an array literal, dictionary literal, tuple or function (because the
[
or(
starting the type was sufficient to disambiguate the type from the parameter’s name). This was never an accepted syntax and we should disallow it.