blob: 2e4c4b55164e7febabdf2fe0f0c7092b7b2aba6f [file] [log] [blame]
Colin Cross1371fe42019-03-19 21:08:48 -07001// compile
2
3// Copyright 2018 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// Non-constant duplicate keys/cases should not be reported
8// as errors by the compiler.
9
10package p
11
12import "unsafe"
13
14func f() {
15 _ = map[uintptr]int{
16 0: 0,
17 uintptr(unsafe.Pointer(nil)): 0,
18 }
19
20 switch uintptr(0) {
21 case 0:
22 case uintptr(unsafe.Pointer(nil)):
23 }
24
25 switch interface{}(nil) {
26 case nil:
27 case nil:
28 }
29
30 _ = map[interface{}]int{
31 nil: 0,
32 nil: 0,
33 }
34}