mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
More tests to come soon. In particular, validation of members used in protocol conformances is still not correct.
31 lines
474 B
Swift
31 lines
474 B
Swift
// RUN: %target-swift-frontend %s -emit-silgen
|
|
|
|
struct Curds {
|
|
var whey: AnyObject? = nil
|
|
}
|
|
|
|
private class Butter {
|
|
fileprivate func churn<T>(block: () throws -> T) throws -> T {
|
|
return try block()
|
|
}
|
|
}
|
|
|
|
struct Cow {
|
|
private var b : Butter
|
|
init() {
|
|
self.b = Butter()
|
|
}
|
|
|
|
func cheese() throws {
|
|
let a = Curds()
|
|
let b = Curds()
|
|
let c = Curds()
|
|
var err = 0
|
|
var newChild = 0
|
|
|
|
defer { }
|
|
|
|
try self.b.churn { return () }
|
|
}
|
|
}
|