mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
I did this using a sed pattern and verified by hand that I was only touching target-swift-emit-silgen lines.
23 lines
616 B
Swift
23 lines
616 B
Swift
// RUN: %target-swift-emit-silgen -verify %s
|
|
class BlockBox<T> {
|
|
let block: (T) -> Void = { _ in }
|
|
|
|
var computedBlock: (T) -> Void { return { _ in } }
|
|
}
|
|
|
|
struct BlockStruct<T> {
|
|
let block: (T) -> Void = { _ in }
|
|
var computedBlock: (T) -> Void { return { _ in } }
|
|
}
|
|
|
|
func escapingCompletion(completion: @escaping (String) -> Void) {}
|
|
|
|
func foo(box: BlockBox<String>) {
|
|
escapingCompletion(completion: box.block)
|
|
escapingCompletion(completion: box.computedBlock)
|
|
}
|
|
func foo(struc: BlockStruct<String>) {
|
|
escapingCompletion(completion: struc.block)
|
|
escapingCompletion(completion: struc.computedBlock)
|
|
}
|