In src/cmd/compile/internal/noder/stencil.go:626 looks like nameNode or nameNode.Func is nil.
// checkFetchBody checks if a generic body can be fetched, but hasn't been loaded// yet. If so, it imports the body.funccheckFetchBody(nameNode*ir.Name) {
ifnameNode.Func.Body==nil&&nameNode.Func.Inl!=nil {
// If there is no body yet but Func.Inl exists, then we can can// import the whole generic body.assert(nameNode.Func.Inl.Cost==1&&nameNode.Sym().Pkg!=types.LocalPkg)
The text was updated successfully, but these errors were encountered:
cloneable
changed the title
cmd/compile: SIGSEGV in noder.checkFetchBody. noder.checkFetchBody is nil?
cmd/compile: SIGSEGV in noder.checkFetchBody
Oct 31, 2021
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Code uses generics, so can't build with 1.17.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Building a package with
go build .
after I moved some generic types and functions into a separate package. No functional change, pure refactor.Changing
Y
's return type toFn[T]
(and returningfunc() (r R[T]
) also prevents a crash.What did you expect to see?
The package compile fine as it did just minutes before.
What did you see instead?
In src/cmd/compile/internal/noder/stencil.go:626 looks like
nameNode
ornameNode.Func
is nil.The text was updated successfully, but these errors were encountered: