-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/compile: "internal compiler error: mayCall" in method of parameterized type #47924
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Simpler reproducer. Compiling package p
import "sync"
type Cache[K, V any] struct {
m sync.Map
}
func (c *Cache[K, V]) foo(x interface{}, f func(K) bool) {
f(x.(K))
}
var _ Cache[int, int] produces:
|
Even simpler reproducer: package p
type Cache[K any] struct {}
func (c Cache[K]) foo(x interface{}, f func(K) bool) {
f(x.(K))
}
var _ Cache[int] For reference, this version compiles fine:
|
@randall77 Do you want to look at this, since it involves DYNAMICDOTTYPE? Seems like we probably just add DYNAMICDOTTYPE in with the case with DOTTYPE in function walk.go:mayCall(), since DYNAMICDOTTYPE can also panic, like all the other ops in that case. |
Change https://golang.org/cl/344571 mentions this issue: |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
n/a
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
cmd/go/internal/work.Cache
. See CL 344513, PS1.go test cmd/go/internal/par
.What did you expect to see?
Tests pass
What did you see instead?
The text was updated successfully, but these errors were encountered: