github.com/powerman/golang-tools@v0.1.11-0.20220410185822-5ad214d8d803/go/pointer/testdata/issue9002.go (about)

     1  package main
     2  
     3  func main() {
     4  	// Regression test for golang issue 9002.
     5  	//
     6  	// The two-result "value,ok" receive operation generated a
     7  	// too-wide constraint loading (value int, ok bool), not bool,
     8  	// from the channel.
     9  	//
    10  	// This bug manifested itself in an out-of-bounds array access
    11  	// when the makechan object was the highest-numbered node, as in
    12  	// this program.
    13  	//
    14  	// In more realistic programs it silently resulted in bogus
    15  	// constraints.
    16  	_, _ = <-make(chan int)
    17  }