Skip to content

Sema: Always mark initializers of lazy vars as subsumed #69946

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
Nov 17, 2023

Conversation

tshortli
Copy link
Contributor

Previously, the initializer expressions of lazy vars would only be marked as subsumed when the getter body for the var was synthesized. This didn't work with -experimental-lazy-typechecking since accessor synthesis was not guaranteed to happen. Consequently, SILGen would emit the initializer even though it was already subsumed and then assert/crash since the init had also not been checked and contextualized. Now lazy var inits are marked subsumed in the request creating storage.

Resolves rdar://118421753

Consolidate a couple tests into skip_function_bodies_storage.swift.
Previously, the initializer expressions of lazy vars would only be marked as
subsumed when the getter body for the var was synthesized. This didn't work
with `-experimental-lazy-typechecking` since accessor synthesis was not
guaranteed to happen. Consequently, SILGen would emit the initializer even
though it was already subsumed and then assert/crash since the init had also
not been checked and contextualized. Now lazy var inits are marked subsumed in
the request creating storage.

Resolves rdar://118421753
@tshortli
Copy link
Contributor Author

@swift-ci please smoke test

@tshortli tshortli merged commit 98e65d0 into swiftlang:main Nov 17, 2023
@tshortli tshortli deleted the silgen-lazy-typecheck-lazy-var branch November 17, 2023 06:41
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