Skip to content

Instantly share code, notes, and snippets.

@jasdev
Last active Feb 20, 2022
Embed
What would you like to do?
Dictionary merging with shorthand argument names.
tabGroup1
.merging(tabGroup2, uniquingKeysWith: { $0 }) // ❌ “Contextual closure type `(Tab, Tab) throws -> Tab`
// expects 2 arguments, but 1 was used in closure body.”
tabGroup1
.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