ng icon indicating copy to clipboard operation
ng copied to clipboard

typecheck: unexpected implicit string -> []byte conversion

Open crawshaw opened this issue 8 years ago • 0 comments

ng> import "bytes"
ng> buf := new(bytes.Buffer)
ng> buf.Write("hello")
int(5)
ng> buf.String()
"hello" 

In Go this is an error:

https://play.golang.org/p/43d_2taphY

main.go:7:12: cannot use "hello" (type string) as type []byte in argument to buf.Write

This was accidental, this should be an error in neugram.

crawshaw avatar Dec 06 '17 01:12 crawshaw