go/src/reflect
Josh Bleecher Snyder 760d3b2a16 reflect: allow conversion from slice to array ptr
Note that this removes an invariant:

v.Type().ConvertibleTo(t) might return true,
yet v.Convert(t) might panic nevertheless.

This is a fairly unavoidable consequence of the decision
to add the first-ever conversion that can panic.

ConvertibleTo describes a relationship between types,
but whether the conversion panics now depends on the value,
not just the type.

If this turns out to be a problem, we can add v.ConvertibleTo(t),
or something similar, to allow callers to avoid the panic.

This is the last of the changes needed to complete the implementation.

Fixes #395

Change-Id: I79b7e4dd87a67a47723e00a65d0b1ac6090371b7
Reviewed-on: https://go-review.googlesource.com/c/go/+/301652
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2021-04-21 00:54:39 +00:00
..
internal reflect: fix stack overflow panic when using haveIdenticalUnderlyingType 2021-04-20 20:14:14 +00:00
abi.go reflect: keep pointer register results alive in callMethod 2021-04-14 16:37:06 +00:00
abi_test.go reflect: refactor funcLayout tests 2021-04-06 22:55:58 +00:00
all_test.go reflect: allow conversion from slice to array ptr 2021-04-21 00:54:39 +00:00
asm_386.s reflect: add register ABI support for makeFuncStub and methodValueCall 2021-04-02 16:53:18 +00:00
asm_amd64.s reflect: preserve ctxt across moveMakeFuncArgPtrs 2021-04-16 20:18:11 +00:00
asm_arm.s reflect: add register ABI support for makeFuncStub and methodValueCall 2021-04-02 16:53:18 +00:00
asm_arm64.s reflect: add register ABI support for makeFuncStub and methodValueCall 2021-04-02 16:53:18 +00:00
asm_mips64x.s reflect: fix methodValueCall frame size on mips64 2021-04-02 19:45:52 +00:00
asm_mipsx.s reflect: add register ABI support for makeFuncStub and methodValueCall 2021-04-02 16:53:18 +00:00
asm_ppc64x.s reflect: add register ABI support for makeFuncStub and methodValueCall 2021-04-02 16:53:18 +00:00
asm_riscv64.s reflect: add register ABI support for makeFuncStub and methodValueCall 2021-04-02 16:53:18 +00:00
asm_s390x.s reflect: add register ABI support for makeFuncStub and methodValueCall 2021-04-02 16:53:18 +00:00
asm_wasm.s reflect: add register ABI support for makeFuncStub and methodValueCall 2021-04-02 16:53:18 +00:00
deepequal.go cmd/compile, runtime: store pointers to go:notinheap types indirectly 2020-10-27 21:29:13 +00:00
example_test.go
export_test.go reflect: refactor funcLayout tests 2021-04-06 22:55:58 +00:00
makefunc.go reflect: add register ABI support for makeFuncStub and methodValueCall 2021-04-02 16:53:18 +00:00
set_test.go
swapper.go internal/unsafeheader: consolidate stringHeader and sliceHeader declarations into an internal package 2020-05-01 02:31:29 +00:00
tostring_test.go
type.go reflect: allow conversion from slice to array ptr 2021-04-21 00:54:39 +00:00
value.go reflect: allow conversion from slice to array ptr 2021-04-21 00:54:39 +00:00
visiblefields.go reflect: add VisibleFields function 2021-03-05 23:47:39 +00:00
visiblefields_test.go reflect: add VisibleFields function 2021-03-05 23:47:39 +00:00