diff options
author | Robert Griesemer <gri@golang.org> | 2021-05-27 19:03:16 -0700 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2021-06-02 23:19:26 +0000 |
commit | 848b58e47357965dc5a61fb0ae5535da717e2633 (patch) | |
tree | dd6a3154d729d12cc059eee6418657ab7c747609 /src/cmd/compile/internal/types2/subst.go | |
parent | 97cb0113a358a24931bc91c956da0cb023f2776c (diff) | |
download | go-848b58e47357965dc5a61fb0ae5535da717e2633.tar.gz go-848b58e47357965dc5a61fb0ae5535da717e2633.zip |
[dev.typeparams] cmd/compile/internal/types2: clean up type set/union intersection
- Eliminate the need for bottom type: This is now represented by
an empty union (denoting the set of no types).
- Clean up type set intersection and incorporate tilde information
in intersection operation and satisfaction tests.
- Minor cleanups along the way.
- Note: The intersection algorithm does not always compute the
largest possible intersection. To be addressed in a follow-up CL.
Change-Id: I7fa19df5996da36a4d8f29300d30a0aa4d8a3e5c
Reviewed-on: https://go-review.googlesource.com/c/go/+/323354
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/types2/subst.go')
-rw-r--r-- | src/cmd/compile/internal/types2/subst.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/compile/internal/types2/subst.go b/src/cmd/compile/internal/types2/subst.go index bfec61a065..617a03ddbc 100644 --- a/src/cmd/compile/internal/types2/subst.go +++ b/src/cmd/compile/internal/types2/subst.go @@ -206,7 +206,7 @@ func (check *Checker) satisfies(pos syntax.Pos, targ Type, tpar *TypeParam, smap // Otherwise, targ's type or underlying type must also be one of the interface types listed, if any. if !iface.isSatisfiedBy(targ) { - check.softErrorf(pos, "%s does not satisfy %s (%s not found in %s)", targ, tpar.bound, under(targ), iface.allTypes) + check.softErrorf(pos, "%s does not satisfy %s (%s not found in %s)", targ, tpar.bound, targ, iface.allTypes) return false } @@ -249,7 +249,7 @@ func (subst *subster) typ(typ Type) Type { // Call typOrNil if it's possible that typ is nil. panic("nil typ") - case *Basic, *bottom, *top: + case *Basic, *top: // nothing to do case *Array: |