aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/types2/unify.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2021-02-17 17:56:34 -0800
committerRobert Griesemer <gri@golang.org>2021-02-18 20:47:17 +0000
commit099374b55e8aed17d1e77a1084f8fb78ff2f8162 (patch)
treea93d6b9f5cd0c51a25b3072cddba372c85c850c0 /src/cmd/compile/internal/types2/unify.go
parent653386a89a702b54bb01be893cfd30cddb0e6107 (diff)
downloadgo-099374b55e8aed17d1e77a1084f8fb78ff2f8162.tar.gz
go-099374b55e8aed17d1e77a1084f8fb78ff2f8162.zip
[dev.typeparams] cmd/compile/internal/types2: remove Type.Under method in favor of function
This removes the need for the aType embedded type and brings the types2.Type API in sync with the go/types.Type API. For reasons not fully understood yet, introducing the new under function causes a very long initialization cycle error, which doesn't exist in go/types. For now, circumvent the problem through a helper function variable. This CL also eliminates superflous (former) Under() method calls inside optype calls (optype takes care of this). Plus some minor misc. cleanups and comment adjustments. Change-Id: I86e13ccf6f0b34d7496240ace61a1c84856b6033 Reviewed-on: https://go-review.googlesource.com/c/go/+/293470 Reviewed-by: Robert Findley <rfindley@google.com> Trust: Robert Griesemer <gri@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/types2/unify.go')
-rw-r--r--src/cmd/compile/internal/types2/unify.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/compile/internal/types2/unify.go b/src/cmd/compile/internal/types2/unify.go
index 153df9d622..d2ea2b952b 100644
--- a/src/cmd/compile/internal/types2/unify.go
+++ b/src/cmd/compile/internal/types2/unify.go
@@ -215,9 +215,9 @@ func (u *unifier) nify(x, y Type, p *ifacePair) bool {
// want *Named types.)
switch {
case !isNamed(x) && y != nil && asNamed(y) != nil:
- return u.nify(x, y.Under(), p)
+ return u.nify(x, under(y), p)
case x != nil && asNamed(x) != nil && !isNamed(y):
- return u.nify(x.Under(), y, p)
+ return u.nify(under(x), y, p)
}
}