Files
swift-mirror/test/Serialization/Inputs/def_enum.swift
Jordan Rose 5e9b5472c9 Add Parse + Sema support for '@_frozen'
(currently spelled with an underscore to indicate its WIP state)

Later commits will handle imported enums correctly and implement the
checks for switch cases.
2018-03-20 10:39:01 -07:00

42 lines
593 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())
// }
}
}
public enum Breakfast<Champions> : Int {
case Eggs
case Bacon
case Coffee
}
@_frozen public enum Exhaustive {}