It ought to be captured as unowned into the closure. It's fishy that it crashes with an assertion failure rather than a proper runtime trap, but it seems like this code ought to trap regardless, because the owning reference goes away before even the closure is formed.
Agreed. We should do a better job of diagnosing this at runtime, but essentially we're complaining when we copy the unowned reference into the closure that the reference is already dead, which seems like the right thing to do.
Indeed it should raise a runtime error – for context, the original issue was discovered when building without assertions where the code would sometimes trigger the correct runtime error and sometimes abort with EXC_BAD_ACCESS, which makes me feel like we have a race condition going on somewhere.