Avatar
うそでした。 let dictionary = strings.reduce(into: [:]) { r, e in e.components(separatedBy: ":") => { r[$0[0]] = Int($0[1])! } } だと [String: Int]let dictionary = strings.reduce(into: [:]) { r, e in print(e) e.components(separatedBy: ":") => { r[$0[0]] = Int($0[1])! } } だと [AnyHashable: Int] single expression か否かで変わってくるみたいです。