Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / honnef.co / go / tools@v0.0.1-2020.1.5 / staticcheck / testdata / src / CheckImpossibleTypeAssertion / CheckImpossibleTypeAssertion.go
diff --git a/.config/coc/extensions/coc-go-data/tools/pkg/mod/honnef.co/go/tools@v0.0.1-2020.1.5/staticcheck/testdata/src/CheckImpossibleTypeAssertion/CheckImpossibleTypeAssertion.go b/.config/coc/extensions/coc-go-data/tools/pkg/mod/honnef.co/go/tools@v0.0.1-2020.1.5/staticcheck/testdata/src/CheckImpossibleTypeAssertion/CheckImpossibleTypeAssertion.go
new file mode 100644 (file)
index 0000000..df9a30b
--- /dev/null
@@ -0,0 +1,31 @@
+package pkg
+
+import "fmt"
+
+type i1 interface {
+       String() int
+}
+
+type i2 interface {
+       String() string
+}
+
+type i3 interface {
+       bar() int
+}
+
+type i4 interface {
+       String() int
+       bar() int
+}
+
+func fn() {
+       var v1 i1
+       _ = v1.(i2) // want `impossible type assertion; i1 and i2 contradict each other`
+       _ = v1.(i3)
+       _ = v1.(i4)
+       _ = v1.(fmt.Stringer) // want `impossible type assertion; i1 and fmt.Stringer contradict each other`
+       _ = v1.(interface {   // want `i1 and.+String.+contradict each other`
+               String() string
+       })
+}