Source file
test/fixedbugs/issue23814.go
1
2
3
4
5
6
7
8
9 package main
10
11 func main() {
12
13 _ = string('a')
14 _ = string(-1)
15 _ = string(0xf8)
16
17 type myString string
18 _ = myString(0x65e5)
19
20
21 _ = string([]byte{'h', 'e', 'l', 'l', '\xc3', '\xb8'})
22 _ = string([]byte{})
23 _ = string([]byte(nil))
24
25 type bytes []byte
26 _ = string(bytes{'h', 'e', 'l', 'l', '\xc3', '\xb8'})
27
28 type myByte byte
29 _ = string([]myByte{'w', 'o', 'r', 'l', 'd', '!'})
30 _ = myString([]myByte{'\xf0', '\x9f', '\x8c', '\x8d'})
31
32
33 _ = string([]rune{0x767d, 0x9d6c, 0x7fd4})
34 _ = string([]rune{})
35 _ = string([]rune(nil))
36
37 type runes []rune
38 _ = string(runes{0x767d, 0x9d6c, 0x7fd4})
39
40 type myRune rune
41 _ = string([]myRune{0x266b, 0x266c})
42 _ = myString([]myRune{0x1f30e})
43
44
45 _ = []byte("hellø")
46 _ = []byte("")
47
48 _ = bytes("hellø")
49
50 _ = []myByte("world!")
51 _ = []myByte(myString("🌏"))
52
53
54 _ = []rune(myString("白鵬翔"))
55 _ = []rune("")
56
57 _ = runes("白鵬翔")
58
59 _ = []myRune("♫♬")
60 _ = []myRune(myString("🌐"))
61 }
62
View as plain text