うん、単に if case let _? = optionalInt { ... }
を↓に挙げなかったよって言ってるだけかと。 let array: [Int?] = [1, 2, nil] // Match using an optional pattern. for case let element? in array { ... } // Match using an enum case pattern. for case let .some(element) in array { ... } let optionalInt: Int? = 0 // Match using an optional pattern. if case let unwrapped? = optionalInt { ... } // Match using an enum case pattern. if case let .some(unwrapped) = optionalInt { ... } // Match using optional binding. if let unwrapped = optionalInt { ... } // Match against .some using an optional pattern switch optionalInt { case let unwrapped?: print() case nil: print() } // Match against .some using enum case pattern switch optionalInt { case let .some(unwrapped): print() case nil: print() }