blob: e29f910ba50055061b101d12cd4b7753c4420f66 [file] [log] [blame]
Russ Cox2b1c9b42012-02-16 23:49:30 -05001// errorcheck
Ian Lance Taylor625866a2009-04-29 20:15:59 -07002
3// Copyright 2009 The Go Authors. All rights reserved.
4// Use of this source code is governed by a BSD-style
5// license that can be found in the LICENSE file.
6
7package main
8
9func main() {
10 type Slice []byte;
11 a := [...]byte{ 0 };
Ian Lance Taylor5309fae2010-08-31 07:34:01 -070012 b := Slice(a[0:]); // This should be OK.
Russ Cox9dc22b62009-08-03 11:58:52 -070013 c := Slice(a); // ERROR "invalid|illegal|cannot"
Russ Coxae54cf72009-09-15 12:42:24 -070014 _, _ = b, c;
Ian Lance Taylor625866a2009-04-29 20:15:59 -070015}