From eca23cfd92f373345d58a370ba4913609cbcb8bb Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Sat, 28 Jun 2008 12:50:33 -0700 Subject: [PATCH] slice doesn't work on a string literal SVN=125259 --- test/bugs/bug061.go | 12 ++++++++++++ test/golden.out | 6 ++++++ 2 files changed, 18 insertions(+) create mode 100644 test/bugs/bug061.go diff --git a/test/bugs/bug061.go b/test/bugs/bug061.go new file mode 100644 index 0000000000..698f52c709 --- /dev/null +++ b/test/bugs/bug061.go @@ -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]; +} diff --git a/test/golden.out b/test/golden.out index 0e1a8c6c04..f2ea7592a8 100644 --- a/test/golden.out +++ b/test/golden.out @@ -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) +BUG: known to fail incorrectly + =========== fixedbugs/bug000.go =========== fixedbugs/bug001.go