Which three states are printed for these dictionary lookups?

from Optionals
Swift 6.3.3 intermediate 2 min

Which three states are printed for these dictionary lookups?

swift
let scores: [String: Int?] = ["ready": 8, "waiting": nil]

func state(_ value: Int??) -> String {
    switch value {
    case .none: return "missing"
    case .some(.none): return "waiting"
    case .some(.some(let score)): return "score=\(score)"
    }
}

print(state(scores["ready"]))
print(state(scores["waiting"]))
print(state(scores["unknown"]))
Open in playground
Report an error