mirror of
https://github.com/apple/swift.git
synced 2026-01-02 22:53:12 +01:00
optional callback; retrofit existing implementations. There's a lot of unpleasant traffic in raw pointers here which I'm going to try to clean up. Swift SVN r24123
38 lines
602 B
Swift
38 lines
602 B
Swift
// All of this is required in order to produce materializeForSet
|
|
// declarations for A's properties.
|
|
public protocol NilLiteralConvertible {
|
|
init(nilLiteral: ())
|
|
}
|
|
public enum Optional<T>: NilLiteralConvertible {
|
|
case Some(T)
|
|
case None
|
|
|
|
public init(nilLiteral: ()) { self = .None }
|
|
}
|
|
|
|
public struct Y {}
|
|
|
|
public struct X<U> {
|
|
public var a : U
|
|
|
|
public init(_a : U) {
|
|
a = _a
|
|
}
|
|
|
|
public func doneSomething() {}
|
|
}
|
|
|
|
public class A {
|
|
public var y : Y
|
|
public var x : X<Y>
|
|
|
|
public init() {
|
|
y = Y()
|
|
x = X<Y>(_a: y)
|
|
}
|
|
|
|
public func doSomething() {
|
|
x.doneSomething()
|
|
}
|
|
}
|