summaryrefslogtreecommitdiff
path: root/test/convlit.go
diff options
context:
space:
mode:
Diffstat (limited to 'test/convlit.go')
-rw-r--r--test/convlit.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/convlit.go b/test/convlit.go
index 90ac5490c..1e82d1f2f 100644
--- a/test/convlit.go
+++ b/test/convlit.go
@@ -36,7 +36,7 @@ var good3 int = 1e9
var good4 float64 = 1e20
// explicit conversion of string is okay
-var _ = []int("abc")
+var _ = []rune("abc")
var _ = []byte("abc")
// implicit is not
@@ -47,20 +47,20 @@ var _ []byte = "abc" // ERROR "cannot use|incompatible|invalid"
type Tstring string
var ss Tstring = "abc"
-var _ = []int(ss)
+var _ = []rune(ss)
var _ = []byte(ss)
// implicit is still not
-var _ []int = ss // ERROR "cannot use|incompatible|invalid"
+var _ []rune = ss // ERROR "cannot use|incompatible|invalid"
var _ []byte = ss // ERROR "cannot use|incompatible|invalid"
-// named slice is not
-type Tint []int
+// named slice is now ok
+type Trune []rune
type Tbyte []byte
-var _ = Tint("abc") // ERROR "convert|incompatible|invalid"
-var _ = Tbyte("abc") // ERROR "convert|incompatible|invalid"
+var _ = Trune("abc") // ok
+var _ = Tbyte("abc") // ok
// implicit is still not
-var _ Tint = "abc" // ERROR "cannot use|incompatible|invalid"
+var _ Trune = "abc" // ERROR "cannot use|incompatible|invalid"
var _ Tbyte = "abc" // ERROR "cannot use|incompatible|invalid"