slice doesn't work on a string literal

SVN=125259
This commit is contained in:
Rob Pike 2008-06-28 12:50:33 -07:00
parent 00368bae8c
commit eca23cfd92
2 changed files with 18 additions and 0 deletions

12
test/bugs/bug061.go Normal file
View file

@ -0,0 +1,12 @@
// $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
func main() {
var s string;
s = "0000000000000000000000000000000000000000000000000000000000"[0:7];
}

View file

@ -312,6 +312,12 @@ BUG: crashes
=========== bugs/bug060.go
BUG: crashes
=========== bugs/bug061.go
bugs/bug061.go:7: illegal types for operand: SLICE
bugs/bug061.go:7: illegal types for operand: AS
(<string>*STRING)
BUG: known to fail incorrectly
=========== fixedbugs/bug000.go
=========== fixedbugs/bug001.go