diff options
| author | Josh Bleecher Snyder <josharian@gmail.com> | 2021-03-14 14:31:50 -0700 |
|---|---|---|
| committer | Josh Bleecher Snyder <josharian@gmail.com> | 2021-04-21 00:54:39 +0000 |
| commit | 760d3b2a16544aab553ca7ec6e6ed3bf4dc9aa3f (patch) | |
| tree | a9eac9132e1fa610ecc7af7a4f754cf6dba67dca /src/runtime | |
| parent | c18744377afa1f9c2310c122e6932fa663f9294a (diff) | |
| download | go-760d3b2a16544aab553ca7ec6e6ed3bf4dc9aa3f.tar.xz | |
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>
Diffstat (limited to 'src/runtime')
0 files changed, 0 insertions, 0 deletions
