aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2010-05-24 14:31:43 -0700
committerRuss Cox <rsc@golang.org>2010-05-24 14:31:43 -0700
commite7561de09af6ffc3b3fa6cbc83d92ed945098cd8 (patch)
tree433d8c6f9bd2a7aa584d0ebf17976f5e07d26971
parent21518ea2af400995475ea627b2c56421ca91777b (diff)
downloadgo-e7561de09af6ffc3b3fa6cbc83d92ed945098cd8.tar.gz
go-e7561de09af6ffc3b3fa6cbc83d92ed945098cd8.zip
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
-rw-r--r--doc/go_spec.html7
1 files changed, 4 insertions, 3 deletions
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.
<p>
The address-of operator <code>&amp;</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.