Skip to content

[6.0] Parse: Diagnose empty version numbers #72454

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

Merged

Conversation

tshortli
Copy link
Contributor

@tshortli tshortli commented Mar 20, 2024

  • Explanation: The compiler treats version tuples that are all zeros as empty, or the same as not having a version. Diagnose attempts to specify all-zeroes versions in attributes and availability queries to prevent surprising behavior.
  • Scope: New diagnostics for a rare pattern in source code. The diagnostics are warnings until Swift 6.
  • Radar: rdar://124661151
  • Original PR: Parse: Diagnose empty version numbers #72449
  • Risk: Low because the diagnostics are warnings until Swift 6.
  • Testing: Added new test cases to the compiler test suite.
  • Reviewer: @nkcsgexi

The compiler treats version tuples that are all zeros as empty, or the same as
not having a version. Diagnose attempts to specify all-zeroes versions in
attributes and availability queries to prevent surprising behavior.

Resolves rdar://124661151
@tshortli tshortli added 🍒 release cherry pick Flag: Release branch cherry picks swift 6.0 labels Mar 20, 2024
@tshortli tshortli requested a review from nkcsgexi March 20, 2024 15:12
@tshortli tshortli requested a review from a team as a code owner March 20, 2024 15:12
@tshortli
Copy link
Contributor Author

@swift-ci please test

@tshortli tshortli merged commit 5a527ea into swiftlang:release/6.0 Mar 20, 2024
@tshortli tshortli deleted the invalid-availability-version-6.0 branch March 20, 2024 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks swift 6.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants