mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
While 'defer' is implemented as a local function, it doesn't behave as one. In particular, since SILGen runs it after destroying all local bindings that appear after the 'defer' definition, the body of a 'defer' cannot forward reference captured bindings the way that local functions can. Note that I had to remove a SILGen test case for an older, related issue. The new diagnostic in Sema catches these cases earlier. Fixes rdar://problem/75088379.
4.1 KiB
4.1 KiB