Update to copy of current master Go testsuite.
[official-gcc.git] / gcc / testsuite / go.test / test / fixedbugs / issue5581.go
blob36a4ad671d2c1225416e8d72e99e26e736162ad4
1 // errorcheck
3 // Used to emit a spurious "invalid recursive type" error.
4 // See golang.org/issue/5581.
6 // Copyright 2013 The Go Authors. All rights reserved.
7 // Use of this source code is governed by a BSD-style
8 // license that can be found in the LICENSE file.
10 package main
12 import "fmt"
14 func NewBar() *Bar { return nil }
16 func (x *Foo) Method() (int, error) {
17 for y := range x.m {
18 _ = y.A
20 return 0, nil
23 type Foo struct {
24 m map[*Bar]int
27 type Bar struct {
28 A *Foo
29 B chan Blah // ERROR "undefined.*Blah"
32 func main() {
33 fmt.Println("Hello, playground")