Skip to content

Sema: Correct availability for @inlinable global var accessors bodies #67850

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

Conversation

tshortli
Copy link
Contributor

@tshortli tshortli commented Aug 10, 2023

The bodies of unavailable functions should be typechecked as if they would always run at the deployment target, even if they are @inlinable. This was not the case in the bodies of unavailable @inlinable global var accessors, though, because the availability of the accessor, rather than enclosing var, was being queried. The fix is to use getSemanticUnavailableAttr().

Resolves rdar://113642576

@tshortli tshortli requested review from beccadax, xymus and hborla and removed request for beccadax August 10, 2023 01:53
@tshortli
Copy link
Contributor Author

@swift-ci please test

The bodies of unavailable functions should be typechecked as if they would
always run at the deployment target, even if they are `@inlinable`. This was
not the case in the bodies of unavailable `@inlinable` global var accessor,
though, because the availability of the accessor, rather than enclosing var,
was being queried. The fix is to use `getSemanticUnavailableAttr()`.

Resolves rdar://113642576
@tshortli tshortli force-pushed the unavailable-inlinable-computed-property-availability branch from e89b088 to 2cc1a93 Compare August 10, 2023 04:49
@tshortli
Copy link
Contributor Author

@swift-ci please smoke test

@tshortli tshortli requested a review from artemcm August 10, 2023 15:49
@tshortli tshortli merged commit 22a18e5 into swiftlang:main Aug 10, 2023
@tshortli tshortli deleted the unavailable-inlinable-computed-property-availability branch August 10, 2023 17:17
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.

3 participants