-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.
Milestone
Description
When the same variable is used twice in a "comma ok" statement, the assignment is sometimes carried out right-to-left:
- channel (and function result), left-to-right: https://play.golang.org/p/D8340bbwmV
- map, right-to-left: https://play.golang.org/p/wCHIzyEHb0
- type assertion, right-to-left : https://play.golang.org/p/8rGKxiagbA
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
Labels
FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.