Skip to content

Instantly share code, notes, and snippets.

Last active Feb 20, 2022
What would you like to do?
Dictionary merging with shorthand argument names.
.merging(tabGroup2, uniquingKeysWith: { $0 }) // ❌ “Contextual closure type `(Tab, Tab) throws -> Tab`
// expects 2 arguments, but 1 was used in closure body.”
.merging(tabGroup2, uniquingKeysWith: { $1 }) // Referencing the second of the two-argument closure compiles fine.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment