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

[Parse] Warn if the same argument is specified more than once in @available #20997

Merged

Conversation

beccadax
Copy link
Contributor

@beccadax beccadax commented Dec 4, 2018

Previously, if an argument to an @available attribute was duplicated, the first value would be silently dropped. With this change, the compiler produces a warning instead. (We emit a warning instead of an error to preserve source compatibility.)

Resolves rdar://problem/46348825.

Previously, if the `message` or `available` argument to an `@available` attribute was specified two or more times, the last value would be used and the earlier ones would be silently discarded. This change emits a warning instead; we can strengthen this into an error in a future version of Swift.

Fixes rdar://problem/46348825.
Add the warning for introduced, deprecated, and obsoleted; also ensures behavior is *completely* backwards-compatible by continuing to use the last argument’s value, rather than the first one.
@beccadax
Copy link
Contributor Author

beccadax commented Dec 4, 2018

@swift-ci please smoke test

@beccadax beccadax changed the title A diagnosis from the argument clinic [Parse] Warn if the same argument is specified more than once in @available Dec 4, 2018
@beccadax beccadax merged commit facaad1 into apple:master Dec 4, 2018
@beccadax beccadax deleted the a-diagnosis-from-the-argument-clinic branch December 4, 2018 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants