* fix: detect default comm clause in select from AST The heuristic to distinguish a default comm clause was too weak. Make it robust by using AST. Fixes #646. * rename test to avoid conflict
17 lines
207 B
Go
17 lines
207 B
Go
package main
|
|
|
|
func main() {
|
|
var c interface{} = int64(1)
|
|
q := make(chan struct{})
|
|
select {
|
|
case q <- struct{}{}:
|
|
println("unexpected")
|
|
default:
|
|
_ = c.(int64)
|
|
}
|
|
println("bye")
|
|
}
|
|
|
|
// Output:
|
|
// bye
|