blob: b0366dddec69c88c3a7add6763e541f0f34966ea [file] [log] [blame]
Russ Coxd5269d02009-05-21 14:46:13 -07001// errchk $G -e $D/$F.go
2
3// Copyright 2009 The Go Authors. All rights reserved.
4// Use of this source code is governed by a BSD-style
5// license that can be found in the LICENSE file.
6
7package main
8
9type S struct {
10 A, B, C, X, Y, Z int;
11}
12
13type T struct {
14 S;
15}
16
17var x = 1
Ian Lance Taylor8cbb5d02009-05-31 11:18:52 -070018var a1 = S { 0, X: 1 }; // ERROR "mixture|undefined"
Russ Coxd5269d02009-05-21 14:46:13 -070019var a2 = S { Y: 3, Z: 2, Y: 3 }; // ERROR "duplicate"
Ian Lance Taylor8cbb5d02009-05-31 11:18:52 -070020var a3 = T { 1, 2, 3, 4, 5, 6 }; // ERROR "convert|too many"
21var a4 = [5]byte{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 } // ERROR "index|too many"
Russ Coxd5269d02009-05-21 14:46:13 -070022var a5 = []byte { x: 2 } // ERROR "index"
23
24var ok1 = S { } // should be ok
Russ Coxc2fa45b2009-05-21 16:31:10 -070025var ok2 = T { S: ok1 } // should be ok