1 // Copyright 2011 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
11 // we can have multiple blank imports (was bug)
19 N undeclared /* ERROR "undeclared" */
36 // blank types must be typechecked
37 _ pi /* ERROR "not a type" */
39 _ struct{ pi /* ERROR "not a type" */ }
43 // invalid array types
45 iA0 [... /* ERROR "invalid use of '...'" */ ]byte
46 iA1 [1 /* ERROR "invalid array length" */ <<100]int
47 iA2 [- /* ERROR "invalid array length" */ 1]complex128
48 iA3 ["foo" /* ERROR "invalid array length" */ ]string
53 p1 pi /* ERROR "no single field or method foo" */ .foo
59 Pi pi /* ERROR "not a type" */
61 a /* ERROR "illegal cycle" */ a
62 a /* ERROR "redeclared" */ int
64 // where the cycle error appears depends on the
65 // order in which declarations are processed
66 // (which depends on the order in which a map
67 // is iterated through)
68 b /* ERROR "illegal cycle" */ c
86 u, v, a /* ERROR "redeclared" */ float32
90 // TODO(gri) recognize double-declaration below
91 // U /* ERROR "redeclared" */ int
96 S4/* ERROR "illegal cycle" */ struct {
99 S5 /* ERROR "illegal cycle" */ struct {
113 A2 /* ERROR "illegal cycle" */ [10]A2
114 A3 /* ERROR "illegal cycle" */ [10]struct {
120 F2 func(x, y, z float32)
121 F3 func(x, y, x /* ERROR "redeclared" */ float32)
122 F4 func() (x, y, x /* ERROR "redeclared" */ float32)
123 F5 func(x int) (x /* ERROR "redeclared" */ float32)
130 I3 interface { /* ERROR "multiple methods named m1" */
132 m1 /* ERROR "redeclared" */ ()
135 m1(x, y, x /* ERROR "redeclared" */ float32)
136 m2() (x, y, x /* ERROR "redeclared" */ float32)
137 m3(x int) (x /* ERROR "redeclared" */ float32)
143 S0 /* ERROR "not an interface" */
149 I8 /* ERROR "illegal cycle" */ interface {
152 // Use I09 (rather than I9) because it appears lexically before
153 // I10 so that we get the illegal cycle here rather then in the
154 // declaration of I10. If the implementation sorts by position
155 // rather than name, the error message will still be here.
156 I09 /* ERROR "illegal cycle" */ interface {