You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Labelled arguments passed out of order are evaluated in the declared order #9340
When labelled arguments are passed in a different order than the function declares them, they are evaluated in the declared order, not in source order.
and logs ["a", "b", "c"]. Expected: ["b", "a", "c"], the order in the source.
It is not specific to externals. A plain function value of type (int, ~extra: int, int) => unit called as pp(~extra=b(), a(), c()) also compiles to pp(a(), b(), c()).
ReScript otherwise evaluates arguments left to right (see #9154), so the reordering should bind the arguments that move to temporaries when they have side effects.
Found while reviewing #9231. Reproduced on master 54b923a.
Activity
Evaluate labelled arguments passed out of order in source order
Evaluate labelled arguments passed out of order in source order