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.
7 // Test map declarations of many types, including erroneous ones.
39 _ map[[]int]v // ERROR "invalid map key"
40 _ map[func()]v // ERROR "invalid map key"
41 _ map[map[int]int]v // ERROR "invalid map key"
42 _ map[T1]v // ERROR "invalid map key"
43 _ map[T2]v // ERROR "invalid map key"
44 _ map[T3]v // ERROR "invalid map key"
45 _ map[T4]v // ERROR "invalid map key"
53 type T2 struct { F T1 }
55 type T4 struct { F T3 }
58 type T6 struct { F T5 }
60 type T8 struct { F *T7 }
63 m := make(map[int]int)
64 delete() // ERROR "missing arguments|not enough arguments"
65 delete(m) // ERROR "missing second \(key\) argument|not enough arguments"
66 delete(m, 2, 3) // ERROR "too many arguments"
67 delete(1, m) // ERROR "first argument to delete must be map|argument 1 must be a map|is not a map"