mirror of
https://github.com/golang/go
synced 2024-11-18 23:34:45 -07:00
5228f4b59c
We now expect a type name when in the key or value of a *ast.MapType. I also added an extra filter to expect a comparable type for the key. Change-Id: I647cf4d791b2c0960ad3b12702b91b9bc168599b Reviewed-on: https://go-review.googlesource.com/c/tools/+/197439 Run-TryBot: Rebecca Stambler <rstambler@golang.org> Reviewed-by: Rebecca Stambler <rstambler@golang.org>
19 lines
518 B
Go
19 lines
518 B
Go
package maps
|
|
|
|
func _() {
|
|
var aVar int //@item(mapVar, "aVar", "int", "var")
|
|
|
|
// not comparabale
|
|
type aSlice []int //@item(mapSliceType, "aSlice", "[]int", "type")
|
|
|
|
// comparable
|
|
type aStruct struct{} //@item(mapStructType, "aStruct", "struct{...}", "struct")
|
|
|
|
map[]a{} //@complete("]", mapStructType, mapSliceType, mapVar)
|
|
|
|
map[a]a{} //@complete("]", mapStructType, mapSliceType, mapVar)
|
|
map[a]a{} //@complete("{", mapSliceType, mapStructType, mapVar)
|
|
|
|
map[]a{} //@rank("]", int, mapSliceType)
|
|
}
|