swift
367520cd - Fix two bugs with the isolation of defer bodies.

Commit
56 days ago
Fix two bugs with the isolation of defer bodies. The first bug is that we weren't computing isolation correctly for nested defers. This is an unlikely pattern of code, but it's good to fix. The second bug is that getActorIsolationOfContext was looking through defers, but getActorIsolation itself was not. This was causing defer bodies to be emitted in SILGen without an isolation parameter, which meant that #isolation could not possibly provide the right value. Fixing this involves teaching SILGen that non-async functions can have nonisolated(nonsending) isolation, but that's relatively straightforward. This commit doesn't fix #isolation or adequately test SILGen, but that'll be handled in a follow-up.
Author
Committer
Parents
Loading