aboutsummaryrefslogtreecommitdiff
path: root/src/go/types/api_test.go
diff options
context:
space:
mode:
authorJosh Bleecher Snyder <josharian@gmail.com>2021-03-14 14:27:28 -0700
committerJosh Bleecher Snyder <josharian@gmail.com>2021-04-21 00:54:01 +0000
commitc18744377afa1f9c2310c122e6932fa663f9294a (patch)
tree98ff06cbf6e0e28ab60df13fba8be1ba79d5e31d /src/go/types/api_test.go
parentfaa4fa1a6e94fce4f6fa22524a2bece5125213b6 (diff)
downloadgo-c18744377afa1f9c2310c122e6932fa663f9294a.tar.gz
go-c18744377afa1f9c2310c122e6932fa663f9294a.zip
go/types: allow conversion from slice to array ptr
These match the changes to cmd/compile/internal/types2 in CL 301650. Updates #395 Change-Id: I1e85b6355c8c8fdba0996c26a2505c65fab908d6 Reviewed-on: https://go-review.googlesource.com/c/go/+/301651 Trust: Josh Bleecher Snyder <josharian@gmail.com> Trust: Robert Griesemer <gri@golang.org> Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Findley <rfindley@google.com> Reviewed-by: Robert Griesemer <gri@golang.org>
Diffstat (limited to 'src/go/types/api_test.go')
-rw-r--r--src/go/types/api_test.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/go/types/api_test.go b/src/go/types/api_test.go
index 6998fc0a0d..3438d79024 100644
--- a/src/go/types/api_test.go
+++ b/src/go/types/api_test.go
@@ -1430,6 +1430,9 @@ func TestConvertibleTo(t *testing.T) {
{newDefined(new(Struct)), new(Struct), true},
{newDefined(Typ[Int]), new(Struct), false},
{Typ[UntypedInt], Typ[Int], true},
+ {NewSlice(Typ[Int]), NewPointer(NewArray(Typ[Int], 10)), true},
+ {NewSlice(Typ[Int]), NewArray(Typ[Int], 10), false},
+ {NewSlice(Typ[Int]), NewPointer(NewArray(Typ[Uint], 10)), false},
// Untyped string values are not permitted by the spec, so the below
// behavior is undefined.
{Typ[UntypedString], Typ[String], true},