mirror of
https://github.com/golang/go
synced 2024-11-24 10:40:10 -07:00
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
This commit is contained in:
parent
21518ea2af
commit
e7561de09a
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user