]> Cypherpunks.ru repositories - gostls13.git/blob - test/map1.go
test: use testlib (final 61)
[gostls13.git] / test / map1.go
1 // errorcheck
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
7 package main
8
9 func main() {}
10
11 type v bool
12
13 var (
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[*int]v
34         _ map[struct{}]v
35         _ map[[10]int]v
36
37         // invalid
38         _ map[[]int]v       // ERROR "invalid map key"
39         _ map[func()]v      // ERROR "invalid map key"
40         _ map[map[int]int]v // ERROR "invalid map key"
41 )