Confirming order of operations

I think there's always going to be a strong_retain (or similar) emitted to keep the object around when optional chaining succeeds.

In your example, those retains show up before calling into the arbitrary code of the subexpressions that follow your optional chaining, and aren't released until those calls finish.

This SIL diagram might help:

2 Likes