1
0
mirror of https://github.com/golang/go synced 2024-11-25 02:57:57 -07:00

add bug045: bad nil assigning into array

update robfunc.go (BUG comment deleted)

SVN=122143
This commit is contained in:
Rob Pike 2008-06-11 10:33:20 -07:00
parent 0b3093f0a5
commit e8010b38e4
3 changed files with 35 additions and 18 deletions

21
test/bugs/bug045.go Normal file
View File

@ -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
*/

View 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

View 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;
}