Files
swift-mirror/test/Serialization/Inputs/def_enum.swift
Ben Cohen e9d4687e31 De-underscore @frozen, apply it to structs (#24185)
* De-underscore @frozen for enums

* Add @frozen for structs, deprecate @_fixed_layout for them

* Switch usage from _fixed_layout to frozen
2019-05-30 17:55:37 -07:00

42 lines
592 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 {}