aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/types2
diff options
context:
space:
mode:
authorRobert Findley <rfindley@google.com>2021-08-15 19:47:08 -0400
committerRobert Findley <rfindley@google.com>2021-08-16 12:54:44 +0000
commitc88e3ff6483615f980c8e4ee4d807a84cbaf4515 (patch)
tree5336a0aa22335cc97203c1712c7110b577eeaf18 /src/cmd/compile/internal/types2
parentd043c8ea89d27d2bcb05276b54dc9d5894e8fc2a (diff)
downloadgo-c88e3ff6483615f980c8e4ee4d807a84cbaf4515.tar.gz
go-c88e3ff6483615f980c8e4ee4d807a84cbaf4515.zip
cmd/compile/internal/types2: use the underlying TypeParam in
assignableTo In CL 338310, assignableTo was altered to walk the constituent types of TypeParams rather than Unions, but was not also adjusted to use under rather than optype. This manifested in the port to go/types. Change-Id: Ie057b96ce93cef204af88b536ea49344c9bc8f12 Reviewed-on: https://go-review.googlesource.com/c/go/+/342409 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/types2')
-rw-r--r--src/cmd/compile/internal/types2/operand.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/types2/operand.go b/src/cmd/compile/internal/types2/operand.go
index 8336451e9c..19326b8342 100644
--- a/src/cmd/compile/internal/types2/operand.go
+++ b/src/cmd/compile/internal/types2/operand.go
@@ -273,7 +273,7 @@ func (x *operand) assignableTo(check *Checker, T Type, reason *string) (bool, er
// x is an untyped value representable by a value of type T.
if isUntyped(Vu) {
- if t, ok := Tu.(*TypeParam); ok {
+ if t, ok := under(T).(*TypeParam); ok {
return t.is(func(t *term) bool {
// TODO(gri) this could probably be more efficient
if t.tilde {