]> Cypherpunks repositories - gostls13.git/commitdiff
a couple of bugs around nil are fixed
authorRob Pike <r@golang.org>
Wed, 18 Jun 2008 20:53:51 +0000 (13:53 -0700)
committerRob Pike <r@golang.org>
Wed, 18 Jun 2008 20:53:51 +0000 (13:53 -0700)
SVN=123423

test/fixedbugs/bug045.go [moved from test/bugs/bug045.go with 90% similarity]
test/golden.out
test/nil.go

similarity index 90%
rename from test/bugs/bug045.go
rename to test/fixedbugs/bug045.go
index d6ec0f1e4aefa893b16cf410c7e451196f5a92df..08b6990ae6cd9dca19de9e085de43c82085b1b9c 100644 (file)
@@ -11,9 +11,9 @@ type T struct {
 }
 
 func main() {
-       var ta *[]T;
+       var ta *[]*T;
 
-       ta = new([1]T);
+       ta = new([1]*T);
        ta[0] = nil;
 }
 /*
index 1179f0d7e2510ba85df0536ca8ede9a4639429f2..67fb83f57bb98b3aaa3a12a197a1fc01b23a78cb 100644 (file)
@@ -26,8 +26,6 @@ hello, world
 =========== ./literal.go
 
 =========== ./nil.go
-nil.go:30: illegal conversion of constant to <T>{}
-BUG: known to fail incorrectly
 
 =========== ./sieve.go
 sieve.go:8: fatal error: walktype: switch 1 unknown op SEND l(151)
@@ -210,10 +208,6 @@ BUG: compilation should succeed
 bugs/bug044.go:23: error in shape across assignment
 BUG: compilation should succeed
 
-=========== bugs/bug045.go
-bugs/bug045.go:13: illegal conversion of constant to <T>{}
-BUG: known to fail incorrectly
-
 =========== bugs/bug046.go
 bugs/bug046.go:7: illegal <this> pointer
 BUG: known to fail incorrectly
@@ -304,3 +298,5 @@ BUG: known to fail incorrectly
 =========== fixedbugs/bug028.go
 
 =========== fixedbugs/bug031.go
+
+=========== fixedbugs/bug045.go
index 3062ea372d40130b3a78e887d445eb66c313fa0c..d0cb65dcb306587fb1d39c30fe92b2b1fb70b796 100644 (file)
@@ -21,7 +21,7 @@ func main() {
        var c *chan int;
        var t *T;
        var in IN;
-       var ta *[]T;
+       var ta *[]IN;
 
        i = nil;
        f = nil;
@@ -30,6 +30,6 @@ func main() {
        c = nil;
        t = nil;
        i = nil;
-       ta = new([1]T);
-       ta[0] = nil;  //BUG (see bugs/bug045.go) 
+       ta = new([1]IN);
+       ta[0] = nil;
 }