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 {
|
2022-01-31 22:25:14 -07:00
|
|
|
case f: // ERROR "invalid case f \(type func\(\)\) in switch \(incomparable type\)|can only be compared to nil"
|
2015-12-14 11:42:13 -07:00
|
|
|
}
|
|
|
|
}
|