
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.
26 lines
235 B
Go
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)
|
|
}
|