yyerror("first argument to append must be slice; have %lT", t);
goto error;
}
+ if(!exportassignok(t->type, "append"))
+ goto error;
+
if(n->isddd) {
if(args->next == nil) {
yyerror("cannot use ... on first argument to append");
yyerror("arguments to copy have different element types: %lT and %lT", n->left->type, n->right->type);
goto error;
}
+ if(!exportassignok(n->left->type->type, "copy"))
+ goto error;
goto ret;
case OCONV:
--- /dev/null
+// errchk $G $D/$F.go
+
+// Copyright 2011 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.
+
+// Issue 1387
+package foo
+
+import "bytes"
+
+func i() {
+ a := make([]bytes.Buffer, 1)
+ b := a[0] // ERROR "unexported field"
+}
+
+func f() {
+ a := make([]bytes.Buffer, 1)
+ a = append(a, a...) // ERROR "unexported field"
+}
+
+
+func g() {
+ a := make([]bytes.Buffer, 1)
+ b := make([]bytes.Buffer, 1)
+ copy(b, a) // ERROR "unexported field"
+}