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
In http://play.golang.org/p/RoelsmSVrI, this statement yields two errors:
_ = []byte{"foo"}
// cannot convert "foo" to type byte
// cannot use "foo" (type string) as type byte in array element
One seems like plenty.
FWIW, a similar pair of errors is emitted for other types T in []T{"foo"}.
The text was updated successfully, but these errors were encountered:
It yields two errors only for string and raw string literals where T can be of any type.
two errors:
[]T{""}
[]T{``}
one error:
[]T{string("")}
[]T{string(``)}
[]T{true}
[]T{complex128(1)}
[]T{true}
[]T{string(0x266c)}
[]T{float32(0.49999999)}
[]T{0.49999)}
rsc
changed the title
cmd/gc: duplicate error for string -> []byte{} conversion
cmd/compile: duplicate error for string -> []byte{} conversion
Jun 8, 2015
The text was updated successfully, but these errors were encountered: