go/src/reflect
Joe Tsai 91ef076562 reflect: fix Value.SetIterXXX to check for the read-only bit
v.SetIterXXX(i) is semantically identical to v.Set(i.XXX()).
If the latter panics for unexported values, so should the former.

This change may breaking some programs, but the change is justified
under the "Go 1 and the Future of Go Programs" document because
the "library has a bug that violates the specification".
In this case, the "reflect" package does not accurately match
the behavior of the Go language specification.
Also, this API was recently released, so the number of users
who could be depending on this behavior is hopefully lower.

Fixes #54628

Change-Id: If86ede51f286e38093f6697944c089f616525115
Reviewed-on: https://go-review.googlesource.com/c/go/+/425184
Auto-Submit: Joseph Tsai <joetsai@digital-static.net>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Joseph Tsai <joetsai@digital-static.net>
Reviewed-by: David Chase <drchase@google.com>
2022-09-01 02:24:14 +00:00
..
internal
abi.go cmd/compile,runtime,reflect: move embedded bit from offset to name 2022-06-14 23:22:11 +00:00
abi_test.go all: separate doc comment from //go: directives 2022-04-05 17:54:15 +00:00
all_test.go reflect: fix Value.SetIterXXX to check for the read-only bit 2022-09-01 02:24:14 +00:00
asm_386.s
asm_amd64.s
asm_arm.s
asm_arm64.s all: delete ARM64 non-register ABI fallback path 2022-03-18 18:26:13 +00:00
asm_loong64.s go, math, os, reflect: support standard library for loong64 2022-05-20 15:12:52 +00:00
asm_mips64x.s
asm_mipsx.s
asm_ppc64x.s
asm_riscv64.s reflect, runtime: add reflect support for regabi on riscv64 2022-04-01 01:41:42 +00:00
asm_s390x.s
asm_wasm.s
deepequal.go reflect: use cgo.Incomplete instead of go:notinheap in tests 2022-08-31 01:16:54 +00:00
example_test.go reflect: add example for FieldByName 2022-05-19 20:04:36 +00:00
export_test.go cmd/compile,runtime,reflect: move embedded bit from offset to name 2022-06-14 23:22:11 +00:00
float32reg_generic.go reflect: implement float32 for regabi riscv64 2022-05-04 13:38:32 +00:00
float32reg_ppc64x.s
float32reg_riscv64.s reflect: implement float32 for regabi riscv64 2022-05-04 13:38:32 +00:00
makefunc.go all: gofmt main repo 2022-04-11 16:34:30 +00:00
nih_test.go reflect: use cgo.Incomplete instead of go:notinheap in tests 2022-08-31 01:16:54 +00:00
set_test.go
stubs_ppc64x.go
stubs_riscv64.go reflect: implement float32 for regabi riscv64 2022-05-04 13:38:32 +00:00
swapper.go
tostring_test.go
type.go reflect: FuncOf support more than 50 arguments 2022-08-26 14:32:13 +00:00
value.go reflect: fix Value.SetIterXXX to check for the read-only bit 2022-09-01 02:24:14 +00:00
visiblefields.go
visiblefields_test.go all: consistently use US spelling of present participles 2022-04-08 13:44:41 +00:00