Avatar
let a = xxx { if cond { 1 } else { "" } } // Either<Int, String> let b = xxx { if cond { 1 } else { 2 } } // Int let c = xxx { if cond { Cat() } else { Dog() } } // Either<Cat, Dog> let d: Animal = xxx { if cond { Cat() } else { Dog() } } // Animal こういうのが出来た。 (edited)