Commit Graph

3 Commits

Author SHA1 Message Date
Hamish Knight
5d631990bb [Sema] Avoid walking lazy inits in ContextualizeClosuresAndMacros
We want these to be contextualized as part of
their implicit getter, avoid attempting to
contextualize as part of the PatternBindingDecl.
This avoid incorrectly computing captures as part
of the PatternBindingDecl; as such we also need
to update ActorIsolationChecker to walk lazy inits
as part of the accessor.
2024-12-27 14:44:55 +00:00
Allan Shortlidge
84098f9fb1 Sema: Always mark initializers of lazy vars as subsumed.
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
2023-11-16 18:01:54 -08:00
Allan Shortlidge
29fec064c2 NFC: Rename SILGen skip function bodies tests to match convention.
Consolidate a couple tests into skip_function_bodies_storage.swift.
2023-11-16 16:57:24 -08:00