]> Cypherpunks repositories - gostls13.git/commitdiff
go/types, types2: use | rather than ∪ when printing term lists
authorRobert Griesemer <gri@golang.org>
Tue, 7 Jun 2022 17:33:01 +0000 (10:33 -0700)
committerRobert Griesemer <gri@golang.org>
Tue, 7 Jun 2022 21:37:14 +0000 (21:37 +0000)
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>
src/cmd/compile/internal/types2/termlist.go
src/cmd/compile/internal/types2/termlist_test.go
src/cmd/compile/internal/types2/typeset_test.go
src/go/types/termlist.go
src/go/types/termlist_test.go
src/go/types/typeset_test.go

index a0108c46383e1aee076090d8a2c2bc35d32a8880..43e43ce87c79aeb635c4240f740fe9f641298dca 100644 (file)
@@ -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())
        }
index d1e3bdf88efcc777fc02b99999a494786ef3335d..3005d0edea00ca40fd0e7962320bff9e0e780571 100644 (file)
@@ -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)
index 69eaff741fc808c2cca5f7acbf6c2eb8756c537c..40ca28e525feb5c9c62f8adf411d933837b83acc 100644 (file)
@@ -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{}":           "𝓤",
index 94e49caee04a26ce0fd6b55ebce083fb42f62ecc..6d08ddb397aa3539b4f493bf80cd374fd27ebe4b 100644 (file)
@@ -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())
        }
index f0d58ac1bcf9961cdfe24f2f3847ffaeee2187f0..0ff687ebda69850d7c7a5e119f2da214420dc4e4 100644 (file)
@@ -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)
index 2bbe611376091eb05eaedf4325a44f941fb0a450..51560924839eae230f2c936414202d2c84960cf6 100644 (file)
@@ -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{}":           "𝓤",