]> Cypherpunks repositories - gostls13.git/commitdiff
add bug045: bad nil assigning into array
authorRob Pike <r@golang.org>
Wed, 11 Jun 2008 17:33:20 +0000 (10:33 -0700)
committerRob Pike <r@golang.org>
Wed, 11 Jun 2008 17:33:20 +0000 (10:33 -0700)
update robfunc.go (BUG comment deleted)

SVN=122143

test/bugs/bug045.go [new file with mode: 0644]
test/golden.out
test/ken/robfunc.go

diff --git a/test/bugs/bug045.go b/test/bugs/bug045.go
new file mode 100644 (file)
index 0000000..d6ec0f1
--- /dev/null
@@ -0,0 +1,21 @@
+// $G $D/$F.go && $L $F.$A && ./$A.out
+
+// Copyright 2009 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+type T struct {
+       i int
+}
+
+func main() {
+       var ta *[]T;
+
+       ta = new([1]T);
+       ta[0] = nil;
+}
+/*
+bug045.go:13: fatal error: goc: exit 1
+*/
index f1d3e43e40b7d3402c3c8b7e8477ceba38bdd795..07a07293ee40f025aeb217a1de117dcb274e4f59 100644 (file)
@@ -67,8 +67,6 @@ Hello World!
 =========== ken/litfun.go
 
 =========== ken/mfunc.go
-ken/mfunc.go:13: function call must be single valued (2)
-BUG: known to fail incorrectly
 
 =========== ken/ptrfun.go
 
@@ -82,10 +80,6 @@ BUG: known to fail incorrectly
 =========== ken/robfor.go
 
 =========== ken/robfunc.go
-ken/robfunc.go:74: function call must be single valued (2)
-ken/robfunc.go:79: function call must be single valued (2)
-ken/robfunc.go:84: function call must be single valued (2)
-BUG: known to fail incorrectly
 
 =========== ken/robif.go
 
@@ -242,6 +236,10 @@ BUG: compilation should succeed
 bugs/bug044.go:23: error in shape across assignment
 BUG: compilation should succeed
 
+=========== bugs/bug045.go
+bugs/bug045.go:13: fatal error: naddr: const <T>{<i><int32>INT32;}
+BUG: known to fail incorrectly
+
 =========== fixedbugs/bug000.go
 
 =========== fixedbugs/bug005.go
index addd05b2695d853057da75edfe1a55b7011d08c7..c6b1a10c448a4d0ed2f89561d0ca8e3c389dc85d 100644 (file)
@@ -54,11 +54,9 @@ func (t *T) m10(a int, b float) int {
 
 
 func f9(a int) (i int, f float) {
-// BUG funny return value
        i := 9;
        f := float(9);
        return i, f;
-//     return;
 }
 
 
@@ -83,14 +81,14 @@ func main() {
        r8, s8 = f8(1);
        assertequal(r8, 8, "r8");
        assertequal(int(s8), 8, "s8");
-               var r9 int;
-               var s9 float;
-               r9, s9 = f9(1);
-               assertequal(r9, 9, "r9");
-               assertequal(int(s9), 9, "s9");
-               var t *T = new(T);
-               t.x = 1;
-               t.y = 2;
-               r10 := t.m10(1, 3.0);
-               assertequal(r10, 10, "10");
+       var r9 int;
+       var s9 float;
+       r9, s9 = f9(1);
+       assertequal(r9, 9, "r9");
+       assertequal(int(s9), 9, "s9");
+       var t *T = new(T);
+       t.x = 1;
+       t.y = 2;
+       r10 := t.m10(1, 3.0);
+       assertequal(r10, 10, "10");
 }