kortschak
unread,Jan 29, 2012, 6:39:48 PM1/29/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to golang-nuts
Can someone explain why I can't do this:
package main
type letter byte
func main() {
_ = []letter([]byte{})
}
The underlying representation is the same, so I can't see why this
conversion is not allowed, i.e. its not the same situation as
[]byte([]int{}) or []T([]interface{}).
Just to make this clear from the outset, I'm not asking why the
compiler disallows it (the answer being the spec, as far as I can see,
does not specify that it is possible), I'm asking why the spec
disallows it (this seems to be a common confusion in this type of
question).