mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/gc: clean up string index errors
Unify with array/slice errors, which were already good. Fixes #4232. R=ken2 CC=golang-dev https://golang.org/cl/7271046
This commit is contained in:
parent
4ad505d102
commit
d82dcadb57
3 changed files with 55 additions and 18 deletions
|
|
@ -11,8 +11,8 @@ var s string;
|
|||
var m map[string]int;
|
||||
|
||||
func main() {
|
||||
println(t["hi"]); // ERROR "integer"
|
||||
println(s["hi"]); // ERROR "integer" "to type uint"
|
||||
println(m[0]); // ERROR "map index"
|
||||
println(t["hi"]); // ERROR "non-integer slice index"
|
||||
println(s["hi"]); // ERROR "non-integer string index"
|
||||
println(m[0]); // ERROR "as type string in map index"
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue