2012-02-16 21:51:04 -07:00
|
|
|
// errorcheck
|
2011-09-19 11:11:24 -06:00
|
|
|
|
|
|
|
// Copyright 2011 The Go Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
func main() {}
|
|
|
|
|
|
|
|
type v bool
|
|
|
|
|
|
|
|
var (
|
|
|
|
// valid
|
2011-11-13 20:58:08 -07:00
|
|
|
_ map[int8]v
|
|
|
|
_ map[uint8]v
|
|
|
|
_ map[int16]v
|
|
|
|
_ map[uint16]v
|
|
|
|
_ map[int32]v
|
|
|
|
_ map[uint32]v
|
|
|
|
_ map[int64]v
|
|
|
|
_ map[uint64]v
|
|
|
|
_ map[int]v
|
|
|
|
_ map[uint]v
|
2011-09-19 11:11:24 -06:00
|
|
|
_ map[uintptr]v
|
|
|
|
_ map[float32]v
|
|
|
|
_ map[float64]v
|
|
|
|
_ map[complex64]v
|
|
|
|
_ map[complex128]v
|
|
|
|
_ map[bool]v
|
|
|
|
_ map[string]v
|
|
|
|
_ map[chan int]v
|
|
|
|
_ map[*int]v
|
2011-12-12 20:22:09 -07:00
|
|
|
_ map[struct{}]v
|
|
|
|
_ map[[10]int]v
|
2011-09-19 11:11:24 -06:00
|
|
|
|
|
|
|
// invalid
|
2011-11-13 20:58:08 -07:00
|
|
|
_ map[[]int]v // ERROR "invalid map key"
|
|
|
|
_ map[func()]v // ERROR "invalid map key"
|
|
|
|
_ map[map[int]int]v // ERROR "invalid map key"
|
2011-09-19 11:11:24 -06:00
|
|
|
)
|