Extract Payload for enum cases having associated value

Sure, but that is because a is already defined inside the function body. However, you are allowed to use the same external argument label more than once, as long as they are tied to separate variables inside the function:

func f(a: Int, a b: Int) {
  print(a, b)
}

f(a: 1, a: 2) // prints "1 2"
1 Like