swift
41d3d8f0 - SIL: Don't box a borrowed closure parameter captured by an escaping closure.

Commit
7 days ago
SIL: Don't box a borrowed closure parameter captured by an escaping closure. Lowering the captures of an escaping closure boxes a noncopyable parameter that isn't borrowed, but decided that from the parameter's written ownership. An unannotated closure parameter is borrowed if the closure's type says so, but it was boxed anyway. As a result, an escaping closure that captured such a parameter crashed SILGen instead of being diagnosed like one that captures an explicitly `borrowing` parameter. Use the parameter's lowered ownership. Resolves rdar://190912238.
Author
Committer
Parents
Loading