mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
28 lines
393 B
Swift
28 lines
393 B
Swift
public enum MyError : Error {
|
|
case bad
|
|
}
|
|
|
|
open class BaseClass<T> {
|
|
let value: T
|
|
|
|
public init(value: T) {
|
|
self.value = value
|
|
}
|
|
|
|
open func waitForNothing() async {}
|
|
|
|
open func wait() async -> T {
|
|
return value
|
|
}
|
|
|
|
open func waitForInt() async -> Int {
|
|
return 123
|
|
}
|
|
|
|
open func wait(orThrow: Bool) async throws {
|
|
if orThrow {
|
|
throw MyError.bad
|
|
}
|
|
}
|
|
}
|