It looks like we're sometimes oversharing wrappers for methods, when the methods have the same name but different argument signatures. This is almost certainly a bug in CL 790740.
Reproducer:
go.mod:
a/a.go:
package a
type W struct {
}
func (t W) M(x int) {
println("a.W", x)
}
b/b.go:
package b
type W struct {
}
func (t W) M() {
println("b.W")
}
main.go
package main
import (
"foo.bar/a"
"foo.bar/b"
)
type I interface {
M(int)
}
type J interface {
M()
}
var i I
var j J
type A struct {
a.W
}
type B struct {
b.W
}
func init() {
i = A{}
j = B{}
}
func main() {
i.M(9)
j.M()
}
In 1.27, it prints
At tip, it prints
Discovered in Google's internal test suite.
It looks like we're somehow conflating the wrappers for the two different types. I'm not sure exactly how yet.
@jakebailey
It looks like we're sometimes oversharing wrappers for methods, when the methods have the same name but different argument signatures. This is almost certainly a bug in CL 790740.
Reproducer:
go.mod:
a/a.go:
b/b.go:
main.go
In 1.27, it prints
At tip, it prints
Discovered in Google's internal test suite.
It looks like we're somehow conflating the wrappers for the two different types. I'm not sure exactly how yet.
@jakebailey