From e7561de09af6ffc3b3fa6cbc83d92ed945098cd8 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Mon, 24 May 2010 14:31:43 -0700 Subject: [PATCH] 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 --- 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 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. -- 2.48.1