delve/_fixtures/locationsprog_generic.go
Alessandro Arzilli c207db792a
proc,locspec: support setting breakpoints by func name on generic funcs (#2745)
* proc,locspec: support setting breakpoints by func name on generic funcs

Changes proc.Function to parse function names correctly when they
contain instantiation lists and locspec to match generic functions.

* vendor: update golang.org/x/tools

The old version of golang.org/x/tools is incompatible with the new
iexport format.
2021-10-30 11:52:26 -07:00

25 lines
345 B
Go

package main
import "fmt"
type ParamReceiver[T any] struct {
field T
}
func (r *ParamReceiver[T]) Amethod() {
fmt.Printf("%v\n", r.field)
}
func ParamFunc[T any](arg T) {
fmt.Printf("%v\n", arg)
}
func main() {
var x ParamReceiver[int]
var y ParamReceiver[float64]
x.Amethod()
y.Amethod()
ParamFunc[int](2)
ParamFunc[float32](2)
}