delve/_fixtures/genericintoiface.go
Alessandro Arzilli 788df884e6
proc: use DW_AT_trampoline to detect auto-generated code (#3528)
Use the trampoline attribute to detect auto-generated code. This fixes
a bug where stepping into a method of a generic type called through an
interface will take the debugger into an auto-generated wrapper that
does not have a dictionary and using next will step out of the wrapper.

Fixes a bug reported on the #delve channel of the gophers slack server.
2023-10-16 08:57:33 -07:00

26 lines
235 B
Go

package main
import "fmt"
type Blah[T any] struct {
x T
}
func (b *Blah[T]) F(y T) {
b.x = y
}
type BlahInt interface {
F(int)
}
func callf(b BlahInt) {
b.F(2)
fmt.Println(b)
}
func main() {
b := &Blah[int]{10}
callf(b)
}