blob: 74bfb59945aed466b405a3acf00f3df058b48b8e [file] [log] [blame]
// RUN: %target-swift-frontend -emit-sil -O -primary-file %s
// Just make sure we skip the optimization and not crash here.
//
// Eventually, we can make this work.
//
// <rdar://problem/31725007>
class Foo {
required init() {}
static func foo(_ f: () -> ()) -> Self {
f()
return self.init()
}
}
class Bar: Foo {}
func closures(_ x: String) {
print(Foo.foo { _ = x })
print(Bar.foo { _ = x })
}