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
main.go:9: cannot use "" (type string) as type int in field value
main.go:9: cannot use append(s, Foo literal) (type []int) as type string in assignment
What did you see instead?
main.go:9: cannot use "" (type string) as type int in field value
main.go:9: cannot use append(s, <T> literal) (type []int) as type string in assignment
The text was updated successfully, but these errors were encountered:
main.go:9: cannot use "" (type string) as type int in field value
main.go:9: cannot use Foo literal (type Foo) as type int in append
main.go:9: cannot use append(s, Foo literal) (type []int) as type string in assignment
Root cause:typecheckcomplit() nils out the n.Type upon finding new errors. That hides new errors in children node as well as the type info of current node. Sending out the fix.
$ ./pkg/tool/linux_amd64/compile /tmp/test/main.go
/tmp/test/main.go:9: cannot use "" (type string) as type int in field value
/tmp/test/main.go:9: cannot use Foo literal (type Foo) as type int in append
/tmp/test/main.go:9: cannot use append(s, Foo literal) (type []int) as type string in assignment
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.7.3 linux/amd64
go version devel +b679665 Fri Oct 28 07:58:47 2016 +0000 linux/amd64
What did you do?
https://play.golang.org/p/gGiuxRMO-h
What did you expect to see?
What did you see instead?
The text was updated successfully, but these errors were encountered: