Skip to content

Serialization: Preserve identity of opened generic environments [5.7] #60525

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

slavapestov
Copy link
Contributor

@slavapestov slavapestov commented Aug 12, 2022

Serialization did not record the generic environment of an opened archetype at all.

If a SIL function referenced two opened archetypes @opened(123, P) Self and @ opened(123, P) Self.A from the same generic environment, we would deserialize them into two different generic environments, like @opened(123, P) Self and @opened(321, P) Self.A, so the root archetype of @opened(321, P) Self.A would be @opened(321, P) Self and not @opened(123, P) Self as expected. This would trigger an assertion when collecting type-dependent operands, because this bogus root archetype was not produced by any instruction in the function.

Cherry-picks a single commit from #60523, fixing #60347.

@slavapestov slavapestov requested a review from a team as a code owner August 12, 2022 04:36
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

We used to create a new environment for each opened archetype, which is
incorrect when deserializing a nested type of another opened archetype.
@slavapestov slavapestov force-pushed the fix-opened-generic-environment-identity-5.7 branch from 55b2478 to aa103c9 Compare August 17, 2022 02:10
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@slavapestov slavapestov merged commit 1726f9d into swiftlang:release/5.7 Aug 17, 2022
@AnthonyLatsis AnthonyLatsis added 🍒 release cherry pick Flag: Release branch cherry picks swift 5.7 labels Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks swift 5.7
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants