diff options
author | Robert Griesemer <gri@golang.org> | 2021-07-27 19:13:26 -0700 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2021-07-29 19:45:02 +0000 |
commit | ff0c0dbca6a7a3a3d6528481829679be4c9d7e94 (patch) | |
tree | f1a8f548ddcfdbb13d0af7811f0efca53709f8f3 /src/cmd/compile/internal/types2/typeset.go | |
parent | 2fa8f00915893670964e05e14be7202f6f97760b (diff) | |
download | go-ff0c0dbca6a7a3a3d6528481829679be4c9d7e94.tar.gz go-ff0c0dbca6a7a3a3d6528481829679be4c9d7e94.zip |
[dev.typeparams] cmd/compile/internal/types2: use type terms to represent unions
This is just an internal representation change for now.
Change-Id: I7e0126e9b17850ec020c2a60db13582761557bea
Reviewed-on: https://go-review.googlesource.com/c/go/+/338092
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
Diffstat (limited to 'src/cmd/compile/internal/types2/typeset.go')
-rw-r--r-- | src/cmd/compile/internal/types2/typeset.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/types2/typeset.go b/src/cmd/compile/internal/types2/typeset.go index cc28625070..5a334b2f53 100644 --- a/src/cmd/compile/internal/types2/typeset.go +++ b/src/cmd/compile/internal/types2/typeset.go @@ -42,6 +42,13 @@ func (s *TypeSet) IsComparable() bool { return s.comparable && tcomparable } +// TODO(gri) IsTypeSet is not a great name. Find a better one. + +// IsTypeSet reports whether the type set s is represented by a finite set of underlying types. +func (s *TypeSet) IsTypeSet() bool { + return !s.comparable && len(s.methods) == 0 +} + // NumMethods returns the number of methods available. func (s *TypeSet) NumMethods() int { return len(s.methods) } |