From: Robert Findley Date: Sun, 15 Aug 2021 23:47:08 +0000 (-0400) Subject: cmd/compile/internal/types2: use the underlying TypeParam in X-Git-Tag: go1.18beta1~1785 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=c88e3ff648;p=gostls13.git 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 Run-TryBot: Robert Findley TryBot-Result: Go Bot Reviewed-by: Robert Griesemer --- 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 {