swift
9c24933b - Fix compiler crashes with consuming and borrowing keywords.

Commit
2 years ago
Fix compiler crashes with consuming and borrowing keywords. Without this fix, the new 'consuming' and 'borrowing' keywords cannot be used with trivial types. Which means, for example, they can't be used in macro expansions that work on various types. Fixes patterns like: public func test1(i: consuming Int) -> Int { takeClosure { [i = copy i] in i } } public func test2(i: borrowing Int) -> Int { takeClosure { [i = copy i] in i } } public func test3(i: consuming Int) -> Int { takeClosure { i } } // Sadly, test4 is still incorrectly diagnosed. public func test4(i: borrowing Int) -> Int { takeClosure { i } } Fixes rdar://112795074 (Crash compiling function that has a macro annotation and uses `consuming`)
Author
Committer
Parents
Loading