2015-12-14 11:42:13 -07:00
|
|
|
// errorcheck
|
|
|
|
|
2016-04-10 15:32:26 -06:00
|
|
|
// Copyright 2015 The Go Authors. All rights reserved.
|
2015-12-14 11:42:13 -07:00
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
// Issue 11737 - invalid == not being caught until generated switch code was compiled
|
|
|
|
|
|
|
|
package p
|
|
|
|
|
|
|
|
func f()
|
|
|
|
|
|
|
|
func s(x interface{}) {
|
|
|
|
switch x {
|
2020-12-08 23:01:22 -07:00
|
|
|
case f: // ERROR "invalid case f \(type func\(\)\) in switch \(incomparable type\)|cannot compare"
|
2015-12-14 11:42:13 -07:00
|
|
|
}
|
|
|
|
}
|