2015-12-14 18:42:13 +00:00
|
|
|
// errorcheck
|
|
|
|
|
2016-04-10 21:32:26 +00:00
|
|
|
// Copyright 2015 The Go Authors. All rights reserved.
|
2015-12-14 18:42:13 +00: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 {
|
2022-02-01 05:25:14 +00:00
|
|
|
case f: // ERROR "invalid case f \(type func\(\)\) in switch \(incomparable type\)|can only be compared to nil"
|
2015-12-14 18:42:13 +00:00
|
|
|
}
|
|
|
|
}
|