3 // Copyright 2014 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 // Issue 7214: No duplicate key error for maps with interface{} key type
11 var _ = map[interface{}]int{2: 1, 2: 1} // ERROR "duplicate key"
12 var _ = map[interface{}]int{int(2): 1, int16(2): 1}
13 var _ = map[interface{}]int{int16(2): 1, int16(2): 1} // ERROR "duplicate key"
17 var _ = map[interface{}]int{"a": 1, "a": 1} // ERROR "duplicate key"
18 var _ = map[interface{}]int{"a": 1, S("a"): 1}
19 var _ = map[interface{}]int{S("a"): 1, S("a"): 1} // ERROR "duplicate key"
29 var _ = map[I]int{N(0): 1, N(2): 1}
30 var _ = map[I]int{N(2): 1, N(2): 1} // ERROR "duplicate key"