summaryrefslogtreecommitdiff
path: root/test/fixedbugs/bug027.go
diff options
context:
space:
mode:
Diffstat (limited to 'test/fixedbugs/bug027.go')
-rw-r--r--test/fixedbugs/bug027.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/test/fixedbugs/bug027.go b/test/fixedbugs/bug027.go
index 2c595cb83..95bc06412 100644
--- a/test/fixedbugs/bug027.go
+++ b/test/fixedbugs/bug027.go
@@ -15,9 +15,9 @@ type Vector struct {
}
func New() *Vector {
- v := new(Vector);
+ v := new(*Vector);
v.nelem = 0;
- v.elem = new([10]Element);
+ v.elem = new(*[10]Element);
return v;
}
@@ -33,11 +33,11 @@ func (v *Vector) Insert(e Element) {
type I struct { val int; }; // BUG: can't be local;
func main() {
- i0 := new(I); i0.val = 0;
- i1 := new(I); i1.val = 11;
- i2 := new(I); i2.val = 222;
- i3 := new(I); i3.val = 3333;
- i4 := new(I); i4.val = 44444;
+ i0 := new(*I); i0.val = 0;
+ i1 := new(*I); i1.val = 11;
+ i2 := new(*I); i2.val = 222;
+ i3 := new(*I); i3.val = 3333;
+ i4 := new(*I); i4.val = 44444;
v := New();
print("hi\n");
v.Insert(i4);