Debian Codegraph @

gcc/testsuite/go.test/test/fixedbugs/issue24470.go

raw
1 // errorcheck
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 // Verify that we get "use of .(type) outside type switch"
8 // before any other (misleading) errors. Test case from issue.
9
10 package p
11
12 func f(i interface{}) {
13 if x, ok := i.(type); ok { // ERROR "outside type switch"
14 }
15 }