AST: Note the attribute that makes a declaration unavailable - #91369
Open
tshortli wants to merge 2 commits into
Open
AST: Note the attribute that makes a declaration unavailable#91369tshortli wants to merge 2 commits into
tshortli wants to merge 2 commits into
Conversation
tshortli
requested review from
CodaFi,
DougGregor,
hamishknight,
hborla,
kathygray-pl,
ktoso,
rintaro,
slavapestov and
xedin
as code owners
August 11, 2026 02:30
Contributor
Author
|
@swift-ci please test |
tshortli
enabled auto-merge
August 11, 2026 02:30
…ions. Expose methods on `AvailabilityRestriction` for emission of notes about attribute responsible for the restriction so that these restrictions can be shared by multiple kinds of availability diagnostics.
Previously, the compiler would emit a note pointing to the unavailable declaration and highlight the range of the attribute that makes the decl unavailable. Unfortunately the highlight is rarely rendered because most frontends only show highlights that are on the same line as the location pointed to by the diagnostic and `@available` is not usually written on the same line as the declaration it is attached to. Switch to pointing to the attribute itself so that this crucial information is always rendered.
tshortli
force-pushed
the
availability-restriction-notes
branch
from
August 11, 2026 15:04
4250b1b to
608e869
Compare
Contributor
Author
|
@swift-ci please test |
Contributor
Author
|
@swift-ci please test Linux |
Contributor
Author
|
@swift-ci please test |
tshortli
disabled auto-merge
August 12, 2026 05:25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, the compiler would emit a note pointing to the unavailable declaration and highlight the range of the attribute that makes the decl unavailable. Unfortunately the highlight is rarely rendered because most frontends only show highlights that are on the same line as the location pointed to by the diagnostic and
@availableis not usually written on the same line as the declaration it is attached to. Switch to pointing to the attribute itself so that this crucial information is always rendered.