1// compile 2 3// Copyright 2016 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// func bad used to fail to compile. 8 9package p 10 11type A [1]int 12 13func bad(x A) { 14 switch x { 15 case A([1]int{1}): 16 case A([1]int{1}): 17 } 18} 19 20func good(x A) { 21 y := A([1]int{1}) 22 z := A([1]int{1}) 23 switch x { 24 case y: 25 case z: 26 } 27} 28