blob: 8834b4453d8a2d8dd403e8594ed800f53928a817 [file] [log] [blame]
Russ Cox933d7122013-09-09 13:03:59 -04001// errorcheck
2
3// Used to emit a spurious "invalid recursive type" error.
4// See golang.org/issue/5581.
5
Emmanuel Odeke53fd5222016-04-10 14:32:26 -07006// Copyright 2013 The Go Authors. All rights reserved.
Russ Cox933d7122013-09-09 13:03:59 -04007// Use of this source code is governed by a BSD-style
8// license that can be found in the LICENSE file.
9
10package main
11
12import "fmt"
13
14func NewBar() *Bar { return nil }
15
16func (x *Foo) Method() (int, error) {
17 for y := range x.m {
18 _ = y.A
19 }
20 return 0, nil
21}
22
23type Foo struct {
24 m map[*Bar]int
25}
26
27type Bar struct {
28 A *Foo
Ian Lance Taylor161a45a2013-12-12 17:18:12 -080029 B chan Blah // ERROR "undefined.*Blah"
Russ Cox933d7122013-09-09 13:03:59 -040030}
31
32func main() {
33 fmt.Println("Hello, playground")
34}