{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/15620","repository_url":"https://api.github.com/repos/golang/go","labels_url":"https://api.github.com/repos/golang/go/issues/15620/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/15620/comments","events_url":"https://api.github.com/repos/golang/go/issues/15620/events","html_url":"https://github.com/golang/go/issues/15620","id":153859133,"number":15620,"title":"spec: when exactly do we evaluate the LHS variable in a tuple assignment?","user":{"login":"georgeteo","id":12107160,"avatar_url":"https://avatars0.githubusercontent.com/u/12107160?v=4","gravatar_id":"","url":"https://api.github.com/users/georgeteo","html_url":"https://github.com/georgeteo","followers_url":"https://api.github.com/users/georgeteo/followers","following_url":"https://api.github.com/users/georgeteo/following{/other_user}","gists_url":"https://api.github.com/users/georgeteo/gists{/gist_id}","starred_url":"https://api.github.com/users/georgeteo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/georgeteo/subscriptions","organizations_url":"https://api.github.com/users/georgeteo/orgs","repos_url":"https://api.github.com/users/georgeteo/repos","events_url":"https://api.github.com/users/georgeteo/events{/privacy}","received_events_url":"https://api.github.com/users/georgeteo/received_events","type":"User","site_admin":false},"labels":[{"id":373399998,"url":"https://api.github.com/repos/golang/go/labels/NeedsFix","name":"NeedsFix","color":"ededed","default":false}],"state":"open","locked":false,"assignee":{"login":"griesemer","id":8528975,"avatar_url":"https://avatars2.githubusercontent.com/u/8528975?v=4","gravatar_id":"","url":"https://api.github.com/users/griesemer","html_url":"https://github.com/griesemer","followers_url":"https://api.github.com/users/griesemer/followers","following_url":"https://api.github.com/users/griesemer/following{/other_user}","gists_url":"https://api.github.com/users/griesemer/gists{/gist_id}","starred_url":"https://api.github.com/users/griesemer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/griesemer/subscriptions","organizations_url":"https://api.github.com/users/griesemer/orgs","repos_url":"https://api.github.com/users/griesemer/repos","events_url":"https://api.github.com/users/griesemer/events{/privacy}","received_events_url":"https://api.github.com/users/griesemer/received_events","type":"User","site_admin":false},"assignees":[{"login":"griesemer","id":8528975,"avatar_url":"https://avatars2.githubusercontent.com/u/8528975?v=4","gravatar_id":"","url":"https://api.github.com/users/griesemer","html_url":"https://github.com/griesemer","followers_url":"https://api.github.com/users/griesemer/followers","following_url":"https://api.github.com/users/griesemer/following{/other_user}","gists_url":"https://api.github.com/users/griesemer/gists{/gist_id}","starred_url":"https://api.github.com/users/griesemer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/griesemer/subscriptions","organizations_url":"https://api.github.com/users/griesemer/orgs","repos_url":"https://api.github.com/users/griesemer/repos","events_url":"https://api.github.com/users/griesemer/events{/privacy}","received_events_url":"https://api.github.com/users/griesemer/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/golang/go/milestones/6","html_url":"https://github.com/golang/go/milestone/6","labels_url":"https://api.github.com/repos/golang/go/milestones/6/labels","id":1055141,"number":6,"title":"Unplanned","description":"No plan to fix in any specific release.\r\n","creator":{"login":"rsc","id":104030,"avatar_url":"https://avatars1.githubusercontent.com/u/104030?v=4","gravatar_id":"","url":"https://api.github.com/users/rsc","html_url":"https://github.com/rsc","followers_url":"https://api.github.com/users/rsc/followers","following_url":"https://api.github.com/users/rsc/following{/other_user}","gists_url":"https://api.github.com/users/rsc/gists{/gist_id}","starred_url":"https://api.github.com/users/rsc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsc/subscriptions","organizations_url":"https://api.github.com/users/rsc/orgs","repos_url":"https://api.github.com/users/rsc/repos","events_url":"https://api.github.com/users/rsc/events{/privacy}","received_events_url":"https://api.github.com/users/rsc/received_events","type":"User","site_admin":false},"open_issues":1130,"closed_issues":970,"state":"open","created_at":"2015-04-06T20:47:19Z","updated_at":"2018-03-20T21:53:00Z","due_on":"2099-12-31T08:00:00Z","closed_at":null},"comments":15,"created_at":"2016-05-09T20:12:16Z","updated_at":"2018-03-21T14:32:26Z","closed_at":null,"author_association":"NONE","body":"Please answer these questions before submitting your issue. Thanks!\n1. What version of Go are you using (`go version`)?\n   gccgo version 4.9.3\n2. What operating system and processor architecture are you using (`go env`)?\n   Ubuntu 14.04 on AWS t2.micro\n3. What did you do?\n   If possible, provide a recipe for reproducing the error.\n   A complete runnable program is good.\n   A link on play.golang.org is best.\n\nDeleting from a slice as suggested by https://github.com/golang/go/wiki/SliceTricks, raises an index out of bound error when compiling with gccgo. The following toy program works fine using GC but not with GCCGO: \n\n```\npackage main\n\nimport \"fmt\"\n\nfunc main() {\n    xs := []int{0,1,2,3,4}\n    i := 2\n    xs, xs[len(xs)-1] = append(xs[:i], xs[i+1:]...), 0\n    fmt.Println(xs)\n}\n```\n\nhttps://play.golang.org/p/f039m1h7Z1\n\nNote: while this toy example is a slice of ints, I'm using the delete code for removing an entry from a slice of pointers. The bug is in `xs[len(xs)-1] = 0`.\n1. What did you expect to see?\n\n`[0 1 3 4]`\n1. What did you see instead?\n\n```\npanic: runtime error: index out of range\n\ngoroutine 1 [running]:\nmain.main\n    /home/ubuntu/Go/src/bad/remove.go:8\n```\n"},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/374957775","html_url":"https://github.com/golang/go/issues/15620#issuecomment-374957775","issue_url":"https://api.github.com/repos/golang/go/issues/15620","id":374957775,"user":{"login":"ianlancetaylor","id":3194333,"avatar_url":"https://avatars2.githubusercontent.com/u/3194333?v=4","gravatar_id":"","url":"https://api.github.com/users/ianlancetaylor","html_url":"https://github.com/ianlancetaylor","followers_url":"https://api.github.com/users/ianlancetaylor/followers","following_url":"https://api.github.com/users/ianlancetaylor/following{/other_user}","gists_url":"https://api.github.com/users/ianlancetaylor/gists{/gist_id}","starred_url":"https://api.github.com/users/ianlancetaylor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ianlancetaylor/subscriptions","organizations_url":"https://api.github.com/users/ianlancetaylor/orgs","repos_url":"https://api.github.com/users/ianlancetaylor/repos","events_url":"https://api.github.com/users/ianlancetaylor/events{/privacy}","received_events_url":"https://api.github.com/users/ianlancetaylor/received_events","type":"User","site_admin":false},"created_at":"2018-03-21T14:32:26Z","updated_at":"2018-03-21T14:32:26Z","author_association":"CONTRIBUTOR","body":"In the current spec, the swap `a, b = b, a` is explained by the rule \"first, ... and the expressions on the right are all evaluated in the usual order.\"  Evaluating the expressions on the right means fetching the values from the variables, so the swap becomes (using temporary variables `t0` and `t1`, and adding the rule that the assignments are carried out in left-to-right order):\r\n\r\n    t0, t1 = b, a // order here is unspecified\r\n    a = t0\r\n    b = t1"}}
{"actor":{"display_login":"ianlancetaylor"}}