Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrong evaluation order for splatted args in ref expression #43960

Closed
simeonschaub opened this issue Jan 28, 2022 · 0 comments · Fixed by #44024
Closed

wrong evaluation order for splatted args in ref expression #43960

simeonschaub opened this issue Jan 28, 2022 · 0 comments · Fixed by #44024
Assignees
Labels
bug Indicates an unexpected problem or unintended behavior compiler:lowering Syntax lowering (compiler front end, 2nd stage)

Comments

@simeonschaub
Copy link
Member

This was pointed out on slack:

julia> Meta.@lower a[f(x), g(y)...]
:($(Expr(:thunk, CodeInfo(
    @ none within `top-level scope`
1%1 = g(y)
│   %2 = f(x)
│   %3 = Core.tuple(a, %2)
│   %4 = Core._apply_iterate(Base.iterate, Base.getindex, %3, %1)
└──      return %4
))))

I don't see any reason why g(y) should be evaluated before f(x), so this can probably be considered a bug in lowering.

@simeonschaub simeonschaub added bug Indicates an unexpected problem or unintended behavior compiler:lowering Syntax lowering (compiler front end, 2nd stage) labels Jan 28, 2022
@JeffBezanson JeffBezanson self-assigned this Jan 28, 2022
KristofferC pushed a commit that referenced this issue Feb 15, 2022
KristofferC pushed a commit that referenced this issue Feb 19, 2022
staticfloat pushed a commit that referenced this issue Dec 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior compiler:lowering Syntax lowering (compiler front end, 2nd stage)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants