aboutsummaryrefslogtreecommitdiff
path: root/src/go/types/typeset.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/go/types/typeset.go')
-rw-r--r--src/go/types/typeset.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/go/types/typeset.go b/src/go/types/typeset.go
index 226e438cc9..cbd867dd95 100644
--- a/src/go/types/typeset.go
+++ b/src/go/types/typeset.go
@@ -43,6 +43,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) }