Skip to content

Multiple assignment is evaluated in wrong order #837

Open
@LMMilewski

Description

@LMMilewski

Full example: https://gopherjs.github.io/playground/#/6geYC_5FAf

In the following code:

x[f()] = g()

f should be called before g but isn't. This matters in presence of side-effects.

Spec:
https://golang.org/ref/spec#Assignments
https://golang.org/ref/spec#Order_of_evaluation

cc @dsnet

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsFixNeedsHelpCommunity contributions are welcome for this feature!bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions