Commit 9b62461a authored by Russ Cox's avatar Russ Cox

gc: allow select case expr = <-c

Fixes #1139.

R=ken2
CC=golang-dev
https://golang.org/cl/2194046
parent 4bfcfcf8
......@@ -461,7 +461,7 @@ case:
}
break;
}
| LCASE name '=' expr ':'
| LCASE expr '=' expr ':'
{
// will be converted to OCASE
// right will point to next case
......
// $G $D/$F.go && $L $F.$A && ./$A.out
package main
func f() *int {
println("BUG: called f")
return new(int)
}
func main() {
var x struct {
a int
}
c := make(chan int, 1)
c1 := make(chan int)
c <- 42
select {
case *f() = <-c1:
// nothing
case x.a = <-c:
if x.a != 42 {
println("BUG:", x.a)
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment