From: Russ Cox Date: Mon, 24 May 2010 21:31:43 +0000 (-0700) Subject: spec: index of non-addressable array is not addressable X-Git-Tag: weekly.2010-05-27~28 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=e7561de09af6ffc3b3fa6cbc83d92ed945098cd8;p=gostls13.git 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 https://golang.org/cl/1278041 --- diff --git a/doc/go_spec.html b/doc/go_spec.html index 39067fab8a..156ee6a45b 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.