0

With this:

let (resultA, resultB, resultC) = (a(), b(), c())

What is the order of execution?

  1. a(), then b(), then c(), then set resultA, then set resultB, then set resultC
  2. undefined

Any reference or documentation on the expected behavior?

Cœur
  • 37,241
  • 25
  • 195
  • 267
  • execution order will be as you described in the first option. that is 1(), then b(), then c() – bestiosdeveloper Jun 22 '17 at 05:20
  • 1
    Related: https://stackoverflow.com/questions/32705320/undefined-behavior-or-does-swift-have-sequence-points. I assume that Chris Lattner's statement *"Swift evaluates expressions left to right"* applies here as well. – Martin R Jun 22 '17 at 05:25
  • Thanks @MartinR, would you like to answer so that I mark it as accepted, or would you like to close it as duplicate? – Cœur Jun 22 '17 at 05:27

0 Answers0