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

Sema: Improve diagnostics for decls more available than their containers #62900

Merged

Conversation

tshortli
Copy link
Contributor

@tshortli tshortli commented Jan 7, 2023

Adopt new request-based utilities for looking up the enclosing declaration's availability when type checking an @available attribute. This consolidates implementations of the lookup and improves diagnostics by catching more cases where declarations are more available than their containers.

Builds on #62876.

@tshortli tshortli requested review from xymus and artemcm January 7, 2023 00:08
…ers.

Adopt new request-based utilities for looking up the enclosing declaration's availability when type checking an `@available` attribute. This consolidates implementations of the lookup and improves diagnostics by catching more cases where declarations are more available than their containers.
@tshortli tshortli force-pushed the simplify-availability-attr-diagnostics branch from d49c9fa to abf4d12 Compare January 7, 2023 00:09
@tshortli
Copy link
Contributor Author

tshortli commented Jan 7, 2023

@swift-ci please test

@tshortli tshortli merged commit 6de884b into swiftlang:main Jan 9, 2023
@tshortli tshortli deleted the simplify-availability-attr-diagnostics branch January 9, 2023 22:17
tshortli added a commit to tshortli/swift that referenced this pull request Mar 21, 2023
…tainer.

It turns out that we must allow declarations with `introduced:` availability
nested inside of other declarations that are `unavailable` in order to
influence weak linking. Stop diagnosing declarations as being more available
than their unavailable containers and revert some changes to availability
inference that were designed to avoid creating these nestings but caused
regressions for declarations marked `@_spi_available.`

Reverts parts of swiftlang#64310,
swiftlang#64015, and
swiftlang#62900.
etcwilde pushed a commit to etcwilde/swift that referenced this pull request Apr 19, 2023
…tainer.

It turns out that we must allow declarations with `introduced:` availability
nested inside of other declarations that are `unavailable` in order to
influence weak linking. Stop diagnosing declarations as being more available
than their unavailable containers and revert some changes to availability
inference that were designed to avoid creating these nestings but caused
regressions for declarations marked `@_spi_available.`

Reverts parts of swiftlang#64310,
swiftlang#64015, and
swiftlang#62900.
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.

1 participant