aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2022-06-07 10:33:01 -0700
committerRobert Griesemer <gri@golang.org>2022-06-07 21:37:14 +0000
commitd4fb93be87c38aaf0f68ad91852f9f83be726262 (patch)
treee4706688677323f2bdf32deb542abf884dfd128d
parent346698eea71139280e3b3380554371b5d332ce02 (diff)
downloadgo-d4fb93be87c38aaf0f68ad91852f9f83be726262.tar.gz
go-d4fb93be87c38aaf0f68ad91852f9f83be726262.zip
go/types, types2: use | rather than ∪ when printing term lists
With this change, the termlist String() function prints termlists in the usual Go notation and thus we can use it in error reporting. Preparation for fixing #40350. For #40350. Change-Id: Ia28318841305de234a71af3146ce0c59f5e601a5 Reviewed-on: https://go-review.googlesource.com/c/go/+/410894 Reviewed-by: Robert Griesemer <gri@google.com> Reviewed-by: Robert Findley <rfindley@google.com>
-rw-r--r--src/cmd/compile/internal/types2/termlist.go2
-rw-r--r--src/cmd/compile/internal/types2/termlist_test.go140
-rw-r--r--src/cmd/compile/internal/types2/typeset_test.go6
-rw-r--r--src/go/types/termlist.go2
-rw-r--r--src/go/types/termlist_test.go140
-rw-r--r--src/go/types/typeset_test.go6
6 files changed, 148 insertions, 148 deletions
diff --git a/src/cmd/compile/internal/types2/termlist.go b/src/cmd/compile/internal/types2/termlist.go
index a0108c4638..43e43ce87c 100644
--- a/src/cmd/compile/internal/types2/termlist.go
+++ b/src/cmd/compile/internal/types2/termlist.go
@@ -25,7 +25,7 @@ func (xl termlist) String() string {
var buf bytes.Buffer
for i, x := range xl {
if i > 0 {
- buf.WriteString(" ∪ ")
+ buf.WriteString(" | ")
}
buf.WriteString(x.String())
}
diff --git a/src/cmd/compile/internal/types2/termlist_test.go b/src/cmd/compile/internal/types2/termlist_test.go
index d1e3bdf88e..3005d0edea 100644
--- a/src/cmd/compile/internal/types2/termlist_test.go
+++ b/src/cmd/compile/internal/types2/termlist_test.go
@@ -12,7 +12,7 @@ import (
// maketl makes a term list from a string of the term list.
func maketl(s string) termlist {
s = strings.ReplaceAll(s, " ", "")
- names := strings.Split(s, "∪")
+ names := strings.Split(s, "|")
r := make(termlist, len(names))
for i, n := range names {
r[i] = testTerm(n)
@@ -33,10 +33,10 @@ func TestTermlistString(t *testing.T) {
"int",
"~int",
"myInt",
- "∅ ∪ ∅",
- "𝓤 ∪ 𝓤",
- "∅ ∪ 𝓤 ∪ int",
- "∅ ∪ 𝓤 ∪ int ∪ myInt",
+ "∅ | ∅",
+ "𝓤 | 𝓤",
+ "∅ | 𝓤 | int",
+ "∅ | 𝓤 | int | myInt",
} {
if got := maketl(want).String(); got != want {
t.Errorf("(%v).String() == %v", want, got)
@@ -47,12 +47,12 @@ func TestTermlistString(t *testing.T) {
func TestTermlistIsEmpty(t *testing.T) {
for test, want := range map[string]bool{
"∅": true,
- "∅ ∪ ∅": true,
- "∅ ∪ ∅ ∪ 𝓤": false,
- "∅ ∪ ∅ ∪ myInt": false,
+ "∅ | ∅": true,
+ "∅ | ∅ | 𝓤": false,
+ "∅ | ∅ | myInt": false,
"𝓤": false,
- "𝓤 ∪ int": false,
- "𝓤 ∪ myInt ∪ ∅": false,
+ "𝓤 | int": false,
+ "𝓤 | myInt | ∅": false,
} {
xl := maketl(test)
got := xl.isEmpty()
@@ -65,13 +65,13 @@ func TestTermlistIsEmpty(t *testing.T) {
func TestTermlistIsAll(t *testing.T) {
for test, want := range map[string]bool{
"∅": false,
- "∅ ∪ ∅": false,
- "int ∪ ~string": false,
- "~int ∪ myInt": false,
- "∅ ∪ ∅ ∪ 𝓤": true,
+ "∅ | ∅": false,
+ "int | ~string": false,
+ "~int | myInt": false,
+ "∅ | ∅ | 𝓤": true,
"𝓤": true,
- "𝓤 ∪ int": true,
- "myInt ∪ 𝓤": true,
+ "𝓤 | int": true,
+ "myInt | 𝓤": true,
} {
xl := maketl(test)
got := xl.isAll()
@@ -86,17 +86,17 @@ func TestTermlistNorm(t *testing.T) {
xl, want string
}{
{"∅", "∅"},
- {"∅ ∪ ∅", "∅"},
- {"∅ ∪ int", "int"},
- {"∅ ∪ myInt", "myInt"},
- {"𝓤 ∪ int", "𝓤"},
- {"𝓤 ∪ myInt", "𝓤"},
- {"int ∪ myInt", "int ∪ myInt"},
- {"~int ∪ int", "~int"},
- {"~int ∪ myInt", "~int"},
- {"int ∪ ~string ∪ int", "int ∪ ~string"},
- {"~int ∪ string ∪ 𝓤 ∪ ~string ∪ int", "𝓤"},
- {"~int ∪ string ∪ myInt ∪ ~string ∪ int", "~int ∪ ~string"},
+ {"∅ | ∅", "∅"},
+ {"∅ | int", "int"},
+ {"∅ | myInt", "myInt"},
+ {"𝓤 | int", "𝓤"},
+ {"𝓤 | myInt", "𝓤"},
+ {"int | myInt", "int | myInt"},
+ {"~int | int", "~int"},
+ {"~int | myInt", "~int"},
+ {"int | ~string | int", "int | ~string"},
+ {"~int | string | 𝓤 | ~string | int", "𝓤"},
+ {"~int | string | myInt | ~string | int", "~int | ~string"},
} {
xl := maketl(test.xl)
got := maketl(test.xl).norm()
@@ -116,15 +116,15 @@ func TestTermlistUnion(t *testing.T) {
{"∅", "int", "int"},
{"𝓤", "~int", "𝓤"},
{"int", "~int", "~int"},
- {"int", "string", "int ∪ string"},
- {"int", "myInt", "int ∪ myInt"},
+ {"int", "string", "int | string"},
+ {"int", "myInt", "int | myInt"},
{"~int", "myInt", "~int"},
- {"int ∪ string", "~string", "int ∪ ~string"},
- {"~int ∪ string", "~string ∪ int", "~int ∪ ~string"},
- {"~int ∪ string ∪ ∅", "~string ∪ int", "~int ∪ ~string"},
- {"~int ∪ myInt ∪ ∅", "~string ∪ int", "~int ∪ ~string"},
- {"~int ∪ string ∪ 𝓤", "~string ∪ int", "𝓤"},
- {"~int ∪ string ∪ myInt", "~string ∪ int", "~int ∪ ~string"},
+ {"int | string", "~string", "int | ~string"},
+ {"~int | string", "~string | int", "~int | ~string"},
+ {"~int | string | ∅", "~string | int", "~int | ~string"},
+ {"~int | myInt | ∅", "~string | int", "~int | ~string"},
+ {"~int | string | 𝓤", "~string | int", "𝓤"},
+ {"~int | string | myInt", "~string | int", "~int | ~string"},
} {
xl := maketl(test.xl)
yl := maketl(test.yl)
@@ -150,12 +150,12 @@ func TestTermlistIntersect(t *testing.T) {
{"int", "string", "∅"},
{"int", "myInt", "∅"},
{"~int", "myInt", "myInt"},
- {"int ∪ string", "~string", "string"},
- {"~int ∪ string", "~string ∪ int", "int ∪ string"},
- {"~int ∪ string ∪ ∅", "~string ∪ int", "int ∪ string"},
- {"~int ∪ myInt ∪ ∅", "~string ∪ int", "int"},
- {"~int ∪ string ∪ 𝓤", "~string ∪ int", "int ∪ ~string"},
- {"~int ∪ string ∪ myInt", "~string ∪ int", "int ∪ string"},
+ {"int | string", "~string", "string"},
+ {"~int | string", "~string | int", "int | string"},
+ {"~int | string | ∅", "~string | int", "int | string"},
+ {"~int | myInt | ∅", "~string | int", "int"},
+ {"~int | string | 𝓤", "~string | int", "int | ~string"},
+ {"~int | string | myInt", "~string | int", "int | string"},
} {
xl := maketl(test.xl)
yl := maketl(test.yl)
@@ -174,12 +174,12 @@ func TestTermlistEqual(t *testing.T) {
{"∅", "∅", true},
{"∅", "𝓤", false},
{"𝓤", "𝓤", true},
- {"𝓤 ∪ int", "𝓤", true},
- {"𝓤 ∪ int", "string ∪ 𝓤", true},
- {"𝓤 ∪ myInt", "string ∪ 𝓤", true},
- {"int ∪ ~string", "string ∪ int", false},
- {"~int ∪ string", "string ∪ myInt", false},
- {"int ∪ ~string ∪ ∅", "string ∪ int ∪ ~string", true},
+ {"𝓤 | int", "𝓤", true},
+ {"𝓤 | int", "string | 𝓤", true},
+ {"𝓤 | myInt", "string | 𝓤", true},
+ {"int | ~string", "string | int", false},
+ {"~int | string", "string | myInt", false},
+ {"int | ~string | ∅", "string | int | ~string", true},
} {
xl := maketl(test.xl)
yl := maketl(test.yl)
@@ -201,11 +201,11 @@ func TestTermlistIncludes(t *testing.T) {
{"int", "string", false},
{"~int", "string", false},
{"~int", "myInt", true},
- {"int ∪ string", "string", true},
- {"~int ∪ string", "int", true},
- {"~int ∪ string", "myInt", true},
- {"~int ∪ myInt ∪ ∅", "myInt", true},
- {"myInt ∪ ∅ ∪ 𝓤", "int", true},
+ {"int | string", "string", true},
+ {"~int | string", "int", true},
+ {"~int | string", "myInt", true},
+ {"~int | myInt | ∅", "myInt", true},
+ {"myInt | ∅ | 𝓤", "int", true},
} {
xl := maketl(test.xl)
yl := testTerm(test.typ).typ
@@ -236,12 +236,12 @@ func TestTermlistSupersetOf(t *testing.T) {
{"myInt", "~int", false},
{"int", "string", false},
{"~int", "string", false},
- {"int ∪ string", "string", true},
- {"int ∪ string", "~string", false},
- {"~int ∪ string", "int", true},
- {"~int ∪ string", "myInt", true},
- {"~int ∪ string ∪ ∅", "string", true},
- {"~string ∪ ∅ ∪ 𝓤", "myInt", true},
+ {"int | string", "string", true},
+ {"int | string", "~string", false},
+ {"~int | string", "int", true},
+ {"~int | string", "myInt", true},
+ {"~int | string | ∅", "string", true},
+ {"~string | ∅ | 𝓤", "myInt", true},
} {
xl := maketl(test.xl)
y := testTerm(test.typ)
@@ -261,18 +261,18 @@ func TestTermlistSubsetOf(t *testing.T) {
{"∅", "𝓤", true},
{"𝓤", "∅", false},
{"𝓤", "𝓤", true},
- {"int", "int ∪ string", true},
- {"~int", "int ∪ string", false},
- {"~int", "myInt ∪ string", false},
- {"myInt", "~int ∪ string", true},
- {"~int", "string ∪ string ∪ int ∪ ~int", true},
- {"myInt", "string ∪ string ∪ ~int", true},
- {"int ∪ string", "string", false},
- {"int ∪ string", "string ∪ int", true},
- {"int ∪ ~string", "string ∪ int", false},
- {"myInt ∪ ~string", "string ∪ int ∪ 𝓤", true},
- {"int ∪ ~string", "string ∪ int ∪ ∅ ∪ string", false},
- {"int ∪ myInt", "string ∪ ~int ∪ ∅ ∪ string", true},
+ {"int", "int | string", true},
+ {"~int", "int | string", false},
+ {"~int", "myInt | string", false},
+ {"myInt", "~int | string", true},
+ {"~int", "string | string | int | ~int", true},
+ {"myInt", "string | string | ~int", true},
+ {"int | string", "string", false},
+ {"int | string", "string | int", true},
+ {"int | ~string", "string | int", false},
+ {"myInt | ~string", "string | int | 𝓤", true},
+ {"int | ~string", "string | int | ∅ | string", false},
+ {"int | myInt", "string | ~int | ∅ | string", true},
} {
xl := maketl(test.xl)
yl := maketl(test.yl)
diff --git a/src/cmd/compile/internal/types2/typeset_test.go b/src/cmd/compile/internal/types2/typeset_test.go
index 69eaff741f..40ca28e525 100644
--- a/src/cmd/compile/internal/types2/typeset_test.go
+++ b/src/cmd/compile/internal/types2/typeset_test.go
@@ -21,13 +21,13 @@ func TestTypeSetString(t *testing.T) {
"{}": "𝓤",
"{int}": "{int}",
"{~int}": "{~int}",
- "{int|string}": "{int ∪ string}",
+ "{int|string}": "{int | string}",
"{int; string}": "∅",
"{comparable}": "{comparable}",
"{comparable; int}": "{int}",
"{~int; comparable}": "{~int}",
- "{int|string; comparable}": "{int ∪ string}",
+ "{int|string; comparable}": "{int | string}",
"{comparable; int; string}": "∅",
"{m()}": "{func (p.T).m()}",
@@ -37,7 +37,7 @@ func TestTypeSetString(t *testing.T) {
"{m1(); comparable; m2() int }": "{comparable; func (p.T).m1(); func (p.T).m2() int}",
"{comparable; error}": "{comparable; func (error).Error() string}",
- "{m(); comparable; int|float32|string}": "{func (p.T).m(); int ∪ float32 ∪ string}",
+ "{m(); comparable; int|float32|string}": "{func (p.T).m(); int | float32 | string}",
"{m1(); int; m2(); comparable }": "{func (p.T).m1(); func (p.T).m2(); int}",
"{E}; type E interface{}": "𝓤",
diff --git a/src/go/types/termlist.go b/src/go/types/termlist.go
index 94e49caee0..6d08ddb397 100644
--- a/src/go/types/termlist.go
+++ b/src/go/types/termlist.go
@@ -25,7 +25,7 @@ func (xl termlist) String() string {
var buf bytes.Buffer
for i, x := range xl {
if i > 0 {
- buf.WriteString(" ∪ ")
+ buf.WriteString(" | ")
}
buf.WriteString(x.String())
}
diff --git a/src/go/types/termlist_test.go b/src/go/types/termlist_test.go
index f0d58ac1bc..0ff687ebda 100644
--- a/src/go/types/termlist_test.go
+++ b/src/go/types/termlist_test.go
@@ -12,7 +12,7 @@ import (
// maketl makes a term list from a string of the term list.
func maketl(s string) termlist {
s = strings.ReplaceAll(s, " ", "")
- names := strings.Split(s, "∪")
+ names := strings.Split(s, "|")
r := make(termlist, len(names))
for i, n := range names {
r[i] = testTerm(n)
@@ -33,10 +33,10 @@ func TestTermlistString(t *testing.T) {
"int",
"~int",
"myInt",
- "∅ ∪ ∅",
- "𝓤 ∪ 𝓤",
- "∅ ∪ 𝓤 ∪ int",
- "∅ ∪ 𝓤 ∪ int ∪ myInt",
+ "∅ | ∅",
+ "𝓤 | 𝓤",
+ "∅ | 𝓤 | int",
+ "∅ | 𝓤 | int | myInt",
} {
if got := maketl(want).String(); got != want {
t.Errorf("(%v).String() == %v", want, got)
@@ -47,12 +47,12 @@ func TestTermlistString(t *testing.T) {
func TestTermlistIsEmpty(t *testing.T) {
for test, want := range map[string]bool{
"∅": true,
- "∅ ∪ ∅": true,
- "∅ ∪ ∅ ∪ 𝓤": false,
- "∅ ∪ ∅ ∪ myInt": false,
+ "∅ | ∅": true,
+ "∅ | ∅ | 𝓤": false,
+ "∅ | ∅ | myInt": false,
"𝓤": false,
- "𝓤 ∪ int": false,
- "𝓤 ∪ myInt ∪ ∅": false,
+ "𝓤 | int": false,
+ "𝓤 | myInt | ∅": false,
} {
xl := maketl(test)
got := xl.isEmpty()
@@ -65,13 +65,13 @@ func TestTermlistIsEmpty(t *testing.T) {
func TestTermlistIsAll(t *testing.T) {
for test, want := range map[string]bool{
"∅": false,
- "∅ ∪ ∅": false,
- "int ∪ ~string": false,
- "~int ∪ myInt": false,
- "∅ ∪ ∅ ∪ 𝓤": true,
+ "∅ | ∅": false,
+ "int | ~string": false,
+ "~int | myInt": false,
+ "∅ | ∅ | 𝓤": true,
"𝓤": true,
- "𝓤 ∪ int": true,
- "myInt ∪ 𝓤": true,
+ "𝓤 | int": true,
+ "myInt | 𝓤": true,
} {
xl := maketl(test)
got := xl.isAll()
@@ -86,17 +86,17 @@ func TestTermlistNorm(t *testing.T) {
xl, want string
}{
{"∅", "∅"},
- {"∅ ∪ ∅", "∅"},
- {"∅ ∪ int", "int"},
- {"∅ ∪ myInt", "myInt"},
- {"𝓤 ∪ int", "𝓤"},
- {"𝓤 ∪ myInt", "𝓤"},
- {"int ∪ myInt", "int ∪ myInt"},
- {"~int ∪ int", "~int"},
- {"~int ∪ myInt", "~int"},
- {"int ∪ ~string ∪ int", "int ∪ ~string"},
- {"~int ∪ string ∪ 𝓤 ∪ ~string ∪ int", "𝓤"},
- {"~int ∪ string ∪ myInt ∪ ~string ∪ int", "~int ∪ ~string"},
+ {"∅ | ∅", "∅"},
+ {"∅ | int", "int"},
+ {"∅ | myInt", "myInt"},
+ {"𝓤 | int", "𝓤"},
+ {"𝓤 | myInt", "𝓤"},
+ {"int | myInt", "int | myInt"},
+ {"~int | int", "~int"},
+ {"~int | myInt", "~int"},
+ {"int | ~string | int", "int | ~string"},
+ {"~int | string | 𝓤 | ~string | int", "𝓤"},
+ {"~int | string | myInt | ~string | int", "~int | ~string"},
} {
xl := maketl(test.xl)
got := maketl(test.xl).norm()
@@ -116,15 +116,15 @@ func TestTermlistUnion(t *testing.T) {
{"∅", "int", "int"},
{"𝓤", "~int", "𝓤"},
{"int", "~int", "~int"},
- {"int", "string", "int ∪ string"},
- {"int", "myInt", "int ∪ myInt"},
+ {"int", "string", "int | string"},
+ {"int", "myInt", "int | myInt"},
{"~int", "myInt", "~int"},
- {"int ∪ string", "~string", "int ∪ ~string"},
- {"~int ∪ string", "~string ∪ int", "~int ∪ ~string"},
- {"~int ∪ string ∪ ∅", "~string ∪ int", "~int ∪ ~string"},
- {"~int ∪ myInt ∪ ∅", "~string ∪ int", "~int ∪ ~string"},
- {"~int ∪ string ∪ 𝓤", "~string ∪ int", "𝓤"},
- {"~int ∪ string ∪ myInt", "~string ∪ int", "~int ∪ ~string"},
+ {"int | string", "~string", "int | ~string"},
+ {"~int | string", "~string | int", "~int | ~string"},
+ {"~int | string | ∅", "~string | int", "~int | ~string"},
+ {"~int | myInt | ∅", "~string | int", "~int | ~string"},
+ {"~int | string | 𝓤", "~string | int", "𝓤"},
+ {"~int | string | myInt", "~string | int", "~int | ~string"},
} {
xl := maketl(test.xl)
yl := maketl(test.yl)
@@ -150,12 +150,12 @@ func TestTermlistIntersect(t *testing.T) {
{"int", "string", "∅"},
{"int", "myInt", "∅"},
{"~int", "myInt", "myInt"},
- {"int ∪ string", "~string", "string"},
- {"~int ∪ string", "~string ∪ int", "int ∪ string"},
- {"~int ∪ string ∪ ∅", "~string ∪ int", "int ∪ string"},
- {"~int ∪ myInt ∪ ∅", "~string ∪ int", "int"},
- {"~int ∪ string ∪ 𝓤", "~string ∪ int", "int ∪ ~string"},
- {"~int ∪ string ∪ myInt", "~string ∪ int", "int ∪ string"},
+ {"int | string", "~string", "string"},
+ {"~int | string", "~string | int", "int | string"},
+ {"~int | string | ∅", "~string | int", "int | string"},
+ {"~int | myInt | ∅", "~string | int", "int"},
+ {"~int | string | 𝓤", "~string | int", "int | ~string"},
+ {"~int | string | myInt", "~string | int", "int | string"},
} {
xl := maketl(test.xl)
yl := maketl(test.yl)
@@ -174,12 +174,12 @@ func TestTermlistEqual(t *testing.T) {
{"∅", "∅", true},
{"∅", "𝓤", false},
{"𝓤", "𝓤", true},
- {"𝓤 ∪ int", "𝓤", true},
- {"𝓤 ∪ int", "string ∪ 𝓤", true},
- {"𝓤 ∪ myInt", "string ∪ 𝓤", true},
- {"int ∪ ~string", "string ∪ int", false},
- {"~int ∪ string", "string ∪ myInt", false},
- {"int ∪ ~string ∪ ∅", "string ∪ int ∪ ~string", true},
+ {"𝓤 | int", "𝓤", true},
+ {"𝓤 | int", "string | 𝓤", true},
+ {"𝓤 | myInt", "string | 𝓤", true},
+ {"int | ~string", "string | int", false},
+ {"~int | string", "string | myInt", false},
+ {"int | ~string | ∅", "string | int | ~string", true},
} {
xl := maketl(test.xl)
yl := maketl(test.yl)
@@ -201,11 +201,11 @@ func TestTermlistIncludes(t *testing.T) {
{"int", "string", false},
{"~int", "string", false},
{"~int", "myInt", true},
- {"int ∪ string", "string", true},
- {"~int ∪ string", "int", true},
- {"~int ∪ string", "myInt", true},
- {"~int ∪ myInt ∪ ∅", "myInt", true},
- {"myInt ∪ ∅ ∪ 𝓤", "int", true},
+ {"int | string", "string", true},
+ {"~int | string", "int", true},
+ {"~int | string", "myInt", true},
+ {"~int | myInt | ∅", "myInt", true},
+ {"myInt | ∅ | 𝓤", "int", true},
} {
xl := maketl(test.xl)
yl := testTerm(test.typ).typ
@@ -236,12 +236,12 @@ func TestTermlistSupersetOf(t *testing.T) {
{"myInt", "~int", false},
{"int", "string", false},
{"~int", "string", false},
- {"int ∪ string", "string", true},
- {"int ∪ string", "~string", false},
- {"~int ∪ string", "int", true},
- {"~int ∪ string", "myInt", true},
- {"~int ∪ string ∪ ∅", "string", true},
- {"~string ∪ ∅ ∪ 𝓤", "myInt", true},
+ {"int | string", "string", true},
+ {"int | string", "~string", false},
+ {"~int | string", "int", true},
+ {"~int | string", "myInt", true},
+ {"~int | string | ∅", "string", true},
+ {"~string | ∅ | 𝓤", "myInt", true},
} {
xl := maketl(test.xl)
y := testTerm(test.typ)
@@ -261,18 +261,18 @@ func TestTermlistSubsetOf(t *testing.T) {
{"∅", "𝓤", true},
{"𝓤", "∅", false},
{"𝓤", "𝓤", true},
- {"int", "int ∪ string", true},
- {"~int", "int ∪ string", false},
- {"~int", "myInt ∪ string", false},
- {"myInt", "~int ∪ string", true},
- {"~int", "string ∪ string ∪ int ∪ ~int", true},
- {"myInt", "string ∪ string ∪ ~int", true},
- {"int ∪ string", "string", false},
- {"int ∪ string", "string ∪ int", true},
- {"int ∪ ~string", "string ∪ int", false},
- {"myInt ∪ ~string", "string ∪ int ∪ 𝓤", true},
- {"int ∪ ~string", "string ∪ int ∪ ∅ ∪ string", false},
- {"int ∪ myInt", "string ∪ ~int ∪ ∅ ∪ string", true},
+ {"int", "int | string", true},
+ {"~int", "int | string", false},
+ {"~int", "myInt | string", false},
+ {"myInt", "~int | string", true},
+ {"~int", "string | string | int | ~int", true},
+ {"myInt", "string | string | ~int", true},
+ {"int | string", "string", false},
+ {"int | string", "string | int", true},
+ {"int | ~string", "string | int", false},
+ {"myInt | ~string", "string | int | 𝓤", true},
+ {"int | ~string", "string | int | ∅ | string", false},
+ {"int | myInt", "string | ~int | ∅ | string", true},
} {
xl := maketl(test.xl)
yl := maketl(test.yl)
diff --git a/src/go/types/typeset_test.go b/src/go/types/typeset_test.go
index 2bbe611376..5156092483 100644
--- a/src/go/types/typeset_test.go
+++ b/src/go/types/typeset_test.go
@@ -22,13 +22,13 @@ func TestTypeSetString(t *testing.T) {
"{}": "𝓤",
"{int}": "{int}",
"{~int}": "{~int}",
- "{int|string}": "{int ∪ string}",
+ "{int|string}": "{int | string}",
"{int; string}": "∅",
"{comparable}": "{comparable}",
"{comparable; int}": "{int}",
"{~int; comparable}": "{~int}",
- "{int|string; comparable}": "{int ∪ string}",
+ "{int|string; comparable}": "{int | string}",
"{comparable; int; string}": "∅",
"{m()}": "{func (p.T).m()}",
@@ -38,7 +38,7 @@ func TestTypeSetString(t *testing.T) {
"{m1(); comparable; m2() int }": "{comparable; func (p.T).m1(); func (p.T).m2() int}",
"{comparable; error}": "{comparable; func (error).Error() string}",
- "{m(); comparable; int|float32|string}": "{func (p.T).m(); int ∪ float32 ∪ string}",
+ "{m(); comparable; int|float32|string}": "{func (p.T).m(); int | float32 | string}",
"{m1(); int; m2(); comparable }": "{func (p.T).m1(); func (p.T).m2(); int}",
"{E}; type E interface{}": "𝓤",