Result<String, Never>
だとswitch
でcase . failure
書かなくても良いのか。 @swift-main
import Foundation enum Result<Value, Error: Swift.Error> { case success(Value) case failure(Error) } func alwaysSucceeds(_ completion: (Result<String, Never>) -> Void) { completion(.success("yes!")) } alwaysSucceeds { (result) in switch result { case .success(let string): print(string) } }