You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Notably the issue goes away if either a.F's return type is changed to *T[int] or either package is compiled with inlining disabled (i.e., -l). I suspect the problem is related to instantiating the type later, resulting in the methods not being added for some reason.
$ cat a.go
package a
func F() interface{} { return new(T[int]) }
type T[P any] int
func (x *T[P]) One() int { return x.Two() }
func (x *T[P]) Two() int { return 0 }
$ cat b.go
package b
import "./a"
var _ = a.F()
$ GOEXPERIMENT=unified go tool compile a.go
$ GOEXPERIMENT=unified go tool compile b.go
/tmp/a.go:7:36: a.x.Two undefined (type *a.T[int] has no field or method Two)
The text was updated successfully, but these errors were encountered:
Thanks for the heads up. I know the issue here (reentrancy issue in unified IR importer code), just need to prepare and submit a fix.
If you want to submit today, probably the easiest thing would be to keep the old files and use the goexperiment.unified build tag to control which ones are used. And then once I fix the issue in unified IR, we can remove the old files and the //go:build directives.
Otherwise, if you can wait a couple days, I should have a fix in for unified IR and you can submit the CL as prepared.
The source files below (distilled from https://go-review.googlesource.com/c/go/+/360015) are valid and should build, but they're failing when unified IR is enabled.
Notably the issue goes away if either a.F's return type is changed to
*T[int]
or either package is compiled with inlining disabled (i.e.,-l
). I suspect the problem is related to instantiating the type later, resulting in the methods not being added for some reason.The text was updated successfully, but these errors were encountered: