diff options
author | Russ Cox <rsc@golang.org> | 2010-05-24 14:31:43 -0700 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2010-05-24 14:31:43 -0700 |
commit | d23a5b77394c06c5b29dc377ed7739c3d3b6eaf4 (patch) | |
tree | d8d00048d9ab3a23c4b38ac4f772351d3059f1e0 /doc/go_spec.html | |
parent | 191d7455af687328936f1295c1941e808706805a (diff) | |
download | golang-d23a5b77394c06c5b29dc377ed7739c3d3b6eaf4.tar.gz |
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
Diffstat (limited to 'doc/go_spec.html')
-rw-r--r-- | doc/go_spec.html | 7 |
1 files 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. <p> The address-of operator <code>&</code> generates the address of its operand, which must be <i>addressable</i>, -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 <code>*</code> retrieves the value pointed to by the operand. |