Files
swift-mirror/test/Serialization/Inputs/def_enum.swift
Jordan Rose 413cfa245d [test] Rename union.swift to enum.swift.
They haven't been "unions" for a long, long time.

Swift SVN r28132
2015-05-04 21:57:01 +00:00

34 lines
474 B
Swift

public enum Basic {
case Untyped
case HasType(Int)
public init() {
self = .Untyped
}
public func doSomething() {}
}
public enum Generic<A> {
case Left(A)
case Right(A)
}
public protocol Computable {
func compute()
}
public enum Lazy<T> : Computable {
case Thunk(() -> T)
case Value(T)
public init(value: T) {
self = .Value(value)
}
public func compute() {
// if (this ~= .Thunk(var fn)) {
// this = .Value(fn())
// }
}
}