golang.org/x/tools/gopls@v0.15.3/internal/test/marker/testdata/signature/generic.txt (about)

     1  This test checks signature help on generic signatures.
     2  
     3  -- g.go --
     4  package g
     5  
     6  type M[K comparable, V any] map[K]V
     7  
     8  // golang/go#61189: signatureHelp must handle pointer receivers. 
     9  func (m *M[K, V]) Get(k K) V {
    10  	return (*m)[k]
    11  }
    12  
    13  func Get[K comparable, V any](m M[K, V], k K) V {
    14  	return m[k]
    15  }
    16  
    17  func _() {
    18  	var m M[int, string]
    19  	_ = m.Get(0)  //@signature("(", "Get(k int) string", 0)
    20  	_ = Get(m, 0) //@signature("0", "Get(m M[int, string], k int) string", 1)
    21  }