You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
6g test2.go && 6l test2.6 && 6.out
test2.go:6: cannot use ts (type Ts) as type string in function argument
package main
func main() {
type Ts string
var ts Ts
_ = []byte(ts)
}
This code is accepted by gccgo; it is legal according to the spec, ts is of string type
(as opposed to type string):
"Converting a value of a string type to []byte (or []uint8) yields a slice whose
successive elements are the bytes of the string."