Files
swift-mirror/test/Concurrency/Runtime/Inputs/resilient_class.swift
Slava Pestov 72e1f02ae2 IRGen: Fix async dispatch thunk emission with loadable return value
Fixes <rdar://problem/74246091>.
2021-02-12 14:06:07 -05:00

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
}
}
}