Avatar
えー、これでもいけるなら get もいけてほしいな。
6:34 AM
@swift-5.2.5 final class Future<Output, Failure: Error> { var result: Result<Output, Failure>? } extension Future { func get() -> Result<Output, Failure>? { result } } extension Future where Failure == Never { func get() -> Output? { try! result?.get() } } let future = Future<Int, Never>() future.result = .success(42) print(future.get()!)