Avatar
Avatar
t.ae
@swift-6.1.2 swift let list = [("One", 1), ("Two", 2), ("Two", 2)] let dict0 = Dictionary(list, uniquingKeysWith: { $0 }) let dict1 = Dictionary(list, uniquingKeysWith: { $1 }) let dict00 = Dictionary(list, uniquingKeysWith: { $0.0 }) let dict01 = Dictionary(list, uniquingKeysWith: { $0.1 }) (edited)
swift61 BOT 7/2/2025 9:02 AM
exit status 1 with stderr:<stdin>:2:48: error: contextual closure type '(Int, Int) throws -> Int' expects 2 arguments, but 1 was used in closure body 1 | let list = [("One", 1), ("Two", 2), ("Two", 2)] 2 | let dict0 = Dictionary(list, uniquingKeysWith: { $0 }) (edited)