aboutsummaryrefslogtreecommitdiff
path: root/gopls/internal/lsp/testdata/typeassert/type_assert.go
blob: e24b68a070a7f98154b78423208e063c958814f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package typeassert

type abc interface { //@item(abcIntf, "abc", "interface{...}", "interface")
	abc()
}

type abcImpl struct{} //@item(abcImpl, "abcImpl", "struct{...}", "struct")
func (abcImpl) abc()

type abcPtrImpl struct{} //@item(abcPtrImpl, "abcPtrImpl", "struct{...}", "struct")
func (*abcPtrImpl) abc()

type abcNotImpl struct{} //@item(abcNotImpl, "abcNotImpl", "struct{...}", "struct")

func _() {
	var a abc
	switch a.(type) {
	case ab: //@complete(":", abcImpl, abcPtrImpl, abcIntf, abcNotImpl)
	case *ab: //@complete(":", abcImpl, abcPtrImpl, abcIntf, abcNotImpl)
	}

	a.(ab)  //@complete(")", abcImpl, abcPtrImpl, abcIntf, abcNotImpl)
	a.(*ab) //@complete(")", abcImpl, abcPtrImpl, abcIntf, abcNotImpl)
}