blob: 3a56cf057dce3cb6dbcfeb839641635855dadffa [file] [log] [blame]
Russ Cox7ca40632011-09-19 13:11:24 -04001// errchk $G -e $D/$F.go
2
3// Copyright 2011 The Go Authors. All rights reserved.
4// Use of this source code is governed by a BSD-style
5// license that can be found in the LICENSE file.
6
7package main
8
9func main() {}
10
11type v bool
12
13var (
14 // valid
15 _ map[int8]v
16 _ map[uint8]v
17 _ map[int16]v
18 _ map[uint16]v
19 _ map[int32]v
20 _ map[uint32]v
21 _ map[int64]v
22 _ map[uint64]v
23 _ map[int]v
24 _ map[uint]v
25 _ map[uintptr]v
26 _ map[float32]v
27 _ map[float64]v
28 _ map[complex64]v
29 _ map[complex128]v
30 _ map[bool]v
31 _ map[string]v
32 _ map[chan int]v
33 _ map[func()]v
34 _ map[*int]v
35 _ map[map[int]int]v
36
37 // invalid
38 _ map[struct{}]v // ERROR "invalid map key"
39 _ map[[]int]v // ERROR "invalid map key"
40 _ map[[10]int]v // ERROR "invalid map key"
41)