package main
type T struct {
a int
}
func (t *T) foo() {
t.a = 3
}
func main() {
var t *T
(*t).foo()
}
This should panic at the second line of main, not inside foo.
Good stack trace:
main.main()
/Users/khr/tmp6.go:13 +0x8
Bad stack trace:
main.(*T).foo(...)
/Users/khr/tmp6.go:8
main.main()
/Users/khr/tmp6.go:13 +0xc
This looks like a regression in #33724. It was fine in 1.24.13, but broken in 1.25.0 and since.
A subtler case, where the dereference is implicit in the conversion from *T to *U:
type T struct {
U
}
type U struct {
x int
}
func (u *U) setX() {
u.x = 7
}
func main() {
var t *T
t.setX()
}
This should panic at the second line of
main, not insidefoo.Good stack trace:
Bad stack trace:
This looks like a regression in #33724. It was fine in 1.24.13, but broken in 1.25.0 and since.
A subtler case, where the dereference is implicit in the conversion from *T to *U: