1 // Copyright 2020 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.
16 {}, // want "redundant type from array, slice, or map composite literal"
17 {1, 2}, // want "redundant type from array, slice, or map composite literal"
18 {3, 4}, // want "redundant type from array, slice, or map composite literal"
22 {}, // want "redundant type from array, slice, or map composite literal"
23 {1, 2}, // want "redundant type from array, slice, or map composite literal"
24 {3, 4}, // want "redundant type from array, slice, or map composite literal"
28 {}, // want "redundant type from array, slice, or map composite literal"
29 {1, 2}, // want "redundant type from array, slice, or map composite literal"
30 {3, 4}, // want "redundant type from array, slice, or map composite literal"
34 {}, // want "redundant type from array, slice, or map composite literal"
35 10: {1, 2}, // want "redundant type from array, slice, or map composite literal"
36 20: {3, 4}, // want "redundant type from array, slice, or map composite literal"
42 {}, // want "redundant type from array, slice, or map composite literal"
43 10: {1, 2}, // want "redundant type from array, slice, or map composite literal"
44 20: {3, 4}, // want "redundant type from array, slice, or map composite literal"
47 var _ = []interface{}{
54 {}, // want "redundant type from array, slice, or map composite literal"
55 {1, 2}, // want "redundant type from array, slice, or map composite literal"
56 {3, 4}, // want "redundant type from array, slice, or map composite literal"
62 {3, 4}, // want "redundant type from array, slice, or map composite literal"
66 {}, // want "redundant type from array, slice, or map composite literal"
67 { // want "redundant type from array, slice, or map composite literal"
68 {}, // want "redundant type from array, slice, or map composite literal"
69 {0, 1, 2, 3}, // want "redundant type from array, slice, or map composite literal"
70 {4, 5}, // want "redundant type from array, slice, or map composite literal"
75 "foo": {}, // want "redundant type from array, slice, or map composite literal"
76 "bar": {1, 2}, // want "redundant type from array, slice, or map composite literal"
77 "bal": {3, 4}, // want "redundant type from array, slice, or map composite literal"
80 var _ = map[string]struct {
83 "foo": {}, // want "redundant type from array, slice, or map composite literal"
84 "bar": {1, 2}, // want "redundant type from array, slice, or map composite literal"
85 "bal": {3, 4}, // want "redundant type from array, slice, or map composite literal"
88 var _ = map[string]interface{}{
94 var _ = map[string][]int{
95 "foo": {}, // want "redundant type from array, slice, or map composite literal"
96 "bar": {1, 2}, // want "redundant type from array, slice, or map composite literal"
97 "bal": {3, 4}, // want "redundant type from array, slice, or map composite literal"
100 var _ = map[string][]int{
102 "bar": ([]int{1, 2}),
103 "bal": {3, 4}, // want "redundant type from array, slice, or map composite literal"
120 // from exp/4s/data.go
121 var pieces3 = []Piece{
122 {0, 0, Point{4, 1}, []Point{{0, 0}, {1, 0}, {1, 0}, {1, 0}}, nil, nil}, // want "redundant type from array, slice, or map composite literal" "redundant type from array, slice, or map composite literal" "redundant type from array, slice, or map composite literal" "redundant type from array, slice, or map composite literal" "redundant type from array, slice, or map composite literal"
123 {1, 0, Point{1, 4}, []Point{{0, 0}, {0, 1}, {0, 1}, {0, 1}}, nil, nil}, // want "redundant type from array, slice, or map composite literal" "redundant type from array, slice, or map composite literal" "redundant type from array, slice, or map composite literal" "redundant type from array, slice, or map composite literal" "redundant type from array, slice, or map composite literal"
124 {2, 0, Point{4, 1}, []Point{{0, 0}, {1, 0}, {1, 0}, {1, 0}}, nil, nil}, // want "redundant type from array, slice, or map composite literal" "redundant type from array, slice, or map composite literal" "redundant type from array, slice, or map composite literal" "redundant type from array, slice, or map composite literal" "redundant type from array, slice, or map composite literal"
125 {3, 0, Point{1, 4}, []Point{{0, 0}, {0, 1}, {0, 1}, {0, 1}}, nil, nil}, // want "redundant type from array, slice, or map composite literal" "redundant type from array, slice, or map composite literal" "redundant type from array, slice, or map composite literal" "redundant type from array, slice, or map composite literal" "redundant type from array, slice, or map composite literal"
129 {}, // want "redundant type from array, slice, or map composite literal"
130 {1, 2}, // want "redundant type from array, slice, or map composite literal"
131 {3, 4}, // want "redundant type from array, slice, or map composite literal"
135 {}, // want "redundant type from array, slice, or map composite literal"
136 {1, 2}, // want "redundant type from array, slice, or map composite literal"
137 {3, 4}, // want "redundant type from array, slice, or map composite literal"
141 {}, // want "redundant type from array, slice, or map composite literal"
142 {1, 2}, // want "redundant type from array, slice, or map composite literal"
143 {3, 4}, // want "redundant type from array, slice, or map composite literal"
147 {}, // want "redundant type from array, slice, or map composite literal"
148 10: {1, 2}, // want "redundant type from array, slice, or map composite literal"
149 20: {3, 4}, // want "redundant type from array, slice, or map composite literal"
155 {}, // want "redundant type from array, slice, or map composite literal"
156 10: {1, 2}, // want "redundant type from array, slice, or map composite literal"
157 20: {3, 4}, // want "redundant type from array, slice, or map composite literal"
160 var _ = []interface{}{
167 {}, // want "redundant type from array, slice, or map composite literal"
168 {1, 2}, // want "redundant type from array, slice, or map composite literal"
169 {3, 4}, // want "redundant type from array, slice, or map composite literal"
175 {3, 4}, // want "redundant type from array, slice, or map composite literal"
179 {}, // want "redundant type from array, slice, or map composite literal"
180 { // want "redundant type from array, slice, or map composite literal"
181 {}, // want "redundant type from array, slice, or map composite literal"
182 {0, 1, 2, 3}, // want "redundant type from array, slice, or map composite literal"
183 {4, 5}, // want "redundant type from array, slice, or map composite literal"
187 var _ = map[string]*T{
188 "foo": {}, // want "redundant type from array, slice, or map composite literal"
189 "bar": {1, 2}, // want "redundant type from array, slice, or map composite literal"
190 "bal": {3, 4}, // want "redundant type from array, slice, or map composite literal"
193 var _ = map[string]*struct {
196 "foo": {}, // want "redundant type from array, slice, or map composite literal"
197 "bar": {1, 2}, // want "redundant type from array, slice, or map composite literal"
198 "bal": {3, 4}, // want "redundant type from array, slice, or map composite literal"
201 var _ = map[string]interface{}{
207 var _ = map[string]*[]int{
208 "foo": {}, // want "redundant type from array, slice, or map composite literal"
209 "bar": {1, 2}, // want "redundant type from array, slice, or map composite literal"
210 "bal": {3, 4}, // want "redundant type from array, slice, or map composite literal"
213 var _ = map[string]*[]int{
215 "bar": (&[]int{1, 2}),
216 "bal": {3, 4}, // want "redundant type from array, slice, or map composite literal"
219 var pieces4 = []*Piece{
220 {0, 0, Point{4, 1}, []Point{{0, 0}, {1, 0}, {1, 0}, {1, 0}}, nil, nil}, // want "redundant type from array, slice, or map composite literal" "redundant type from array, slice, or map composite literal" "redundant type from array, slice, or map composite literal" "redundant type from array, slice, or map composite literal" "redundant type from array, slice, or map composite literal"
221 {1, 0, Point{1, 4}, []Point{{0, 0}, {0, 1}, {0, 1}, {0, 1}}, nil, nil}, // want "redundant type from array, slice, or map composite literal" "redundant type from array, slice, or map composite literal" "redundant type from array, slice, or map composite literal" "redundant type from array, slice, or map composite literal" "redundant type from array, slice, or map composite literal"
222 {2, 0, Point{4, 1}, []Point{{0, 0}, {1, 0}, {1, 0}, {1, 0}}, nil, nil}, // want "redundant type from array, slice, or map composite literal" "redundant type from array, slice, or map composite literal" "redundant type from array, slice, or map composite literal" "redundant type from array, slice, or map composite literal" "redundant type from array, slice, or map composite literal"
223 {3, 0, Point{1, 4}, []Point{{0, 0}, {0, 1}, {0, 1}, {0, 1}}, nil, nil}, // want "redundant type from array, slice, or map composite literal" "redundant type from array, slice, or map composite literal" "redundant type from array, slice, or map composite literal" "redundant type from array, slice, or map composite literal" "redundant type from array, slice, or map composite literal"
227 {1, 2}: {3, 4}, // want "redundant type from array, slice, or map composite literal" "redundant type from array, slice, or map composite literal"
228 {5, 6}: {7, 8}, // want "redundant type from array, slice, or map composite literal" "redundant type from array, slice, or map composite literal"
232 {1, 2}: {3, 4}, // want "redundant type from array, slice, or map composite literal" "redundant type from array, slice, or map composite literal"
233 {5, 6}: {7, 8}, // want "redundant type from array, slice, or map composite literal" "redundant type from array, slice, or map composite literal"