Skip to content

cmd/compile: comma ok assignment order is right-to-left for some statements #13433

@trisiak

Description

@trisiak

When the same variable is used twice in a "comma ok" statement, the assignment is sometimes carried out right-to-left:

The specification is consistent and states that:

(...) the assignments are carried out in left-to-right order.

From reading of how OAS2MAP is handled this is clearly an explicit action since the compiler does a rewrite of the statement (https://github.com/golang/go/blob/go1.5.1/src/cmd/compile/internal/gc/walk.go#L808-L881). I could not find the reason for why OAS2DOTTYPE doesn't follow the specification.

This is the case for at least go1.5.1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions