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 the following program:
package main
func main() {
var a float64
var s string
s[0] = a
}
The program reports:
prog.go:6: cannot assign to s[0]
prog.go:6: cannot use a (type float64) as type uint8 in assignment
There are two issues here. First, there are two errors when there could be one. This is
related to issue #6406. Second, the type mismatch is stated as float64 vs uint8, but it
should be float64 vs. byte. I'm not sure if these two issues are related, so I'm filing
them as one issue, but I can file a second issue if they are distinct.
The text was updated successfully, but these errors were encountered:
rsc
changed the title
cmd/gc: spurious error when indexing into string, bad type mismatch report
cmd/compile: spurious error when indexing into string, bad type mismatch report
Jun 8, 2015
rsc
changed the title
cmd/compile: spurious error when indexing into string, bad type mismatch report
cmd/compile: spurious type mismatch error when assigning float64 to indexed string byte
Jun 29, 2015
The text was updated successfully, but these errors were encountered: