diff options
author | Robert Griesemer <gri@golang.org> | 2021-08-04 15:18:37 -0700 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2021-08-06 20:34:43 +0000 |
commit | 5aac85ad5ebfa9c2ecb01a3292bcf3513d876d7a (patch) | |
tree | c058cc9c80087967f248f1e126664cb8ea08307b /src/cmd/compile/internal/types2/typeterm.go | |
parent | 110343e4a2a953a581e34e91e51cef08856b0b0a (diff) | |
download | go-5aac85ad5ebfa9c2ecb01a3292bcf3513d876d7a.tar.gz go-5aac85ad5ebfa9c2ecb01a3292bcf3513d876d7a.zip |
[dev.typeparams] cmd/compile/internal/types2: better names for things (cleanup)
- use the symbol π€ (as in π€niverse) instead of β€ to denote the set
of all types (for better readabilty, β€ is hard to distinguish from
T in some fonts)
- use isAll instead of isTop to test for the set of all types
- use allTermlist instead of topTermlist to denote the termlist
representing all types
Change-Id: Idcb0b3398782b38653338e65173c0dbb935e430a
Reviewed-on: https://go-review.googlesource.com/c/go/+/339891
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
Diffstat (limited to 'src/cmd/compile/internal/types2/typeterm.go')
-rw-r--r-- | src/cmd/compile/internal/types2/typeterm.go | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/src/cmd/compile/internal/types2/typeterm.go b/src/cmd/compile/internal/types2/typeterm.go index 59a89cb004..8edbefa579 100644 --- a/src/cmd/compile/internal/types2/typeterm.go +++ b/src/cmd/compile/internal/types2/typeterm.go @@ -4,13 +4,10 @@ package types2 -// TODO(gri) use a different symbol instead of β€ for the set of all types -// (β€ is hard to distinguish from T in some fonts) - // A term describes elementary type sets: // // β
: (*term)(nil) == β
// set of no types (empty set) -// β€: &term{} == β€ // set of all types +// π€: &term{} == π€ // set of all types (π€niverse) // T: &term{false, T} == {T} // set of type T // ~t: &term{true, t} == {t' | under(t') == t} // set of types with underlying type t // @@ -24,7 +21,7 @@ func (x *term) String() string { case x == nil: return "β
" case x.typ == nil: - return "β€" + return "π€" case x.tilde: return "~" + x.typ.String() default: @@ -41,7 +38,7 @@ func (x *term) equal(y *term) bool { case x.typ == nil || y.typ == nil: return x.typ == y.typ } - // β
β x, y β β€ + // β
β x, y β π€ return x.tilde == y.tilde && Identical(x.typ, y.typ) } @@ -57,11 +54,11 @@ func (x *term) union(y *term) (_, _ *term) { case y == nil: return x, nil // x βͺ β
== x case x.typ == nil: - return x, nil // β€ βͺ y == β€ + return x, nil // π€ βͺ y == π€ case y.typ == nil: - return y, nil // x βͺ β€ == β€ + return y, nil // x βͺ π€ == π€ } - // β
β x, y β β€ + // β
β x, y β π€ if x.disjoint(y) { return x, y // x βͺ y == (x, y) if x β© y == β
@@ -85,11 +82,11 @@ func (x *term) intersect(y *term) *term { case x == nil || y == nil: return nil // β
β© y == β
and β© β
== β
case x.typ == nil: - return y // β€ β© y == y + return y // π€ β© y == y case y.typ == nil: - return x // x β© β€ == x + return x // x β© π€ == x } - // β
β x, y β β€ + // β
β x, y β π€ if x.disjoint(y) { return nil // x β© y == β
if x β© y == β
@@ -113,9 +110,9 @@ func (x *term) includes(t Type) bool { case x == nil: return false // t β β
== false case x.typ == nil: - return true // t β β€ == true + return true // t β π€ == true } - // β
β x β β€ + // β
β x β π€ u := t if x.tilde { @@ -133,11 +130,11 @@ func (x *term) subsetOf(y *term) bool { case y == nil: return false // x β β
== false since x != β
case y.typ == nil: - return true // x β β€ == true + return true // x β π€ == true case x.typ == nil: - return false // β€ β y == false since y != β€ + return false // π€ β y == false since y != π€ } - // β
β x, y β β€ + // β
β x, y β π€ if x.disjoint(y) { return false // x β y == false if x β© y == β
|