Skip to content

Sema: Improve UseAnyAppleOSAvailability diagnostics#88886

Merged
tshortli merged 4 commits intoswiftlang:mainfrom
tshortli:improve-use-any-apple-os-diags
May 8, 2026
Merged

Sema: Improve UseAnyAppleOSAvailability diagnostics#88886
tshortli merged 4 commits intoswiftlang:mainfrom
tshortli:improve-use-any-apple-os-diags

Conversation

@tshortli
Copy link
Copy Markdown
Contributor

@tshortli tshortli commented May 6, 2026

  • Avoid diagnosing @_spi_available attributes.
  • Avoid diagnosing attributes on implicit decls.
  • Offer fix-its for more complex combinations of @available attributes.
  • Generally improve fix-its that would remove all the non-whitespace text on a line so that they remove the entire line instead.

Resolves of rdar://175677817.

tshortli added 4 commits May 6, 2026 09:38
If the fix-it would remove a range that is followed by a newline and the
remaining text on the line is empty or all whitespace then remove the entire
line. This produces better results when a fix-it removes an attribute that is
written on a line by itself.
…inations.

Expand the fix-its to cover declarations with availability that is split
accross multiple attributes instead listed together in a single short form
`@available` attribute.

Resolves rdar://175677817.
@tshortli tshortli changed the title Sema: Improve UseAnyAppleOSAvailability diagnostics Sema: Improve UseAnyAppleOSAvailability diagnostics May 6, 2026
@tshortli
Copy link
Copy Markdown
Contributor Author

tshortli commented May 6, 2026

@swift-ci please test

@tshortli
Copy link
Copy Markdown
Contributor Author

tshortli commented May 7, 2026

@swift-ci please test macOS

@tshortli
Copy link
Copy Markdown
Contributor Author

tshortli commented May 7, 2026

swiftlang/llvm-project#12912

@swift-ci please test macOS

@tshortli tshortli merged commit 18e4fd7 into swiftlang:main May 8, 2026
6 checks passed
@tshortli tshortli deleted the improve-use-any-apple-os-diags branch May 8, 2026 21:41
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.

2 participants