delve/_fixtures/issue3548.go
Alessandro Arzilli e06a1163d0
proc: add regression test for issue #3548 (#3553)
Issue #3548 describes a bug in the compiler which was fixed by commit
505e50b. But this case wasn't covered by our current tests (obviously)
and the fix in the compiler looks accidental so it's worth adding a
test for it.

Fixes #3548
2023-11-04 10:31:03 -05:00

36 lines
378 B
Go

package main
import (
"fmt"
)
type Thing struct {
str string
}
func (d *Thing) Test() bool {
return d != nil
}
func callit(f func()) {
f()
}
func main() {
cases := []struct {
name string
thing Thing
}{
{
name: "Success",
thing: Thing{str: "hello"},
},
}
for _, c := range cases {
callit(func() {
fmt.Println("hello", c.thing.Test())
})
}
}