Skip to content

[5.5][Sema] Build TRC for delayed functions to fix availability issues in emit-module-separately #39081

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
merged 2 commits into from
Aug 30, 2021

Conversation

xymus
Copy link
Contributor

@xymus xymus commented Aug 27, 2021

Cherry-pick of #39064.

Fix an issue where if #available(...) conditions may be ignored in emit-module-separately builds or when skipping non-inlinable function bodies.

The compiler builds the full TypeRefinementContext of a source file before parsing delayed function bodies. This can lead to availability checking errors in delayed function bodies as the TRCs are incomplete. Make sure we complete the TRC of each delayed function before type-checking them.

rdar://82269657

@xymus xymus requested a review from bnbarham August 27, 2021 20:44
@xymus xymus requested a review from a team as a code owner August 27, 2021 20:44
@xymus
Copy link
Contributor Author

xymus commented Aug 27, 2021

@swift-ci Please test

xymus added 2 commits August 27, 2021 14:18
We used to build the full TypeRefinementContext of a source file before
parsing delayed function bodies. This can lead to availability checking
errors in delayed function bodies as the TRCs are incomplete.

Complete the TRC of each delayed function before type-checking them to
fix this.

rdar://82269657
@xymus xymus force-pushed the rdar82269657-5.5 branch from 444f6eb to 28945da Compare August 27, 2021 21:19
@xymus
Copy link
Contributor Author

xymus commented Aug 27, 2021

@swift-ci Please test

@xymus xymus merged commit 159c946 into swiftlang:release/5.5 Aug 30, 2021
@xymus xymus deleted the rdar82269657-5.5 branch August 30, 2021 22:29
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