{"push_id":743330563,"size":1,"distinct_size":1,"ref":"refs/heads/master","head":"2d9378c7f6dfbbe82d1bbd806093c2dfe57d7e17","before":"f4c775eb70f732000e5260214a1f6e100089a1b0","commits":[{"sha":"2d9378c7f6dfbbe82d1bbd806093c2dfe57d7e17","author":{"email":"a6752097faebf1f02d80107d77a9be009089afe3@golang.org","name":"Robert Griesemer"},"message":"spec: document existing expression switch restrictions\n\nThe spec didn't specify several aspects of expression switches:\n\n- The switch expression is evaluated exactly once.\n\n- Switch expressions evaluating to an untyped value are converted\n  to the respective default type before use.\n\n- An (untyped) nil value is not permitted as expression switch\n  value. (We could permit it relatively easily, but gc doesn't,\n  and disallowing it is in symmetry with the rules for var decls\n  without explicit type and untyped initializer expressions.)\n\n- The comparison x == t between each case expression x and\n  switch expression value t must be valid.\n\n- (Some) duplicate constant case expressions are not permitted.\n\nThis change also clarifies the following issues:\n\n 4524: mult. equal int const switch case values should be illegal\n                                         -> spec issue fixed\n 6398: switch w/ no value uses bool rather than untyped bool\n                                         -> spec issue fixed\n11578: allows duplicate switch cases     -> go/types bug\n11667: int overflow in switch expression -> go/types bug\n11668: use of untyped nil in switch      -> not a gc bug\n\nFixes #4524.\nFixes #6398.\nFixes #11668.\n\nChange-Id: Iae4ab3e714575a5d11c92c9b8fbf027aa706b370\nReviewed-on: https://go-review.googlesource.com/12711\nReviewed-by: Russ Cox <rsc@golang.org>\nReviewed-by: Rob Pike <r@golang.org>","distinct":true,"url":"https://api.github.com/repos/mk0x9/go/commits/2d9378c7f6dfbbe82d1bbd806093c2dfe57d7e17"}]}