1 // $G $D/$F.go && $L $F.$A && ./$A.out
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.
9 type Element interface {
20 v.elem = make([]Element, 10);
24 func (v *Vector) At(i int) Element {
28 func (v *Vector) Insert(e Element) {
34 type I struct { val int; };
35 i0 := new(I); i0.val = 0;
36 i1 := new(I); i1.val = 11;
37 i2 := new(I); i2.val = 222;
38 i3 := new(I); i3.val = 3333;
39 i4 := new(I); i4.val = 44444;
47 for i := 0; i < v.nelem; i++ {
50 print(i, " ", x.val, "\n"); // prints correct list
52 for i := 0; i < v.nelem; i++ {
53 print(i, " ", v.At(i).(*I).val, "\n");
57 bug027.go:50: illegal types for operand
58 (<Element>I{}) CONV (<I>{})
59 bug027.go:50: illegal types for operand
60 (<Element>I{}) CONV (<I>{})