Skip to content

wrong evaluation order for splatted args in ref expression #43960

Closed
@simeonschaub

Description

@simeonschaub

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.

Metadata

Metadata

Assignees

Labels

bugIndicates an unexpected problem or unintended behaviorcompiler:loweringSyntax lowering (compiler front end, 2nd stage)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions