From d23a5b77394c06c5b29dc377ed7739c3d3b6eaf4 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Mon, 24 May 2010 14:31:43 -0700 Subject: spec: index of non-addressable array is not addressable Motivated by: func f() []int func g() [10]int f()[1] = 1 // ok g()[1] = 1 // ERROR R=gri CC=golang-dev http://codereview.appspot.com/1278041 --- doc/go_spec.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/go_spec.html b/doc/go_spec.html index 39067fab8..156ee6a45 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -3017,9 +3017,10 @@ The right operand is evaluated conditionally.

The address-of operator & generates the address of its operand, which must be addressable, -that is, either a variable, pointer indirection, array or slice indexing -operation, -or a field selector of an addressable struct operand. +that is, either a variable, pointer indirection, or slice indexing +operation; +or a field selector of an addressable struct operand; +or an array indexing operation of an addressable array. Given an operand of pointer type, the pointer indirection operator * retrieves the value pointed to by the operand. -- cgit v1.2.3