Skip to content

cmd/compile: internal compiler error: misuse of CaptureName on closure variable #47684

Closed
@ALTree

Description

@ALTree
$ gotip version
go version devel go1.18-4c8ffb3baa Fri Aug 13 00:20:28 2021 +0000 linux/amd64

Was playing around with -G=3 after the dev.typeparams merge into master.

package main

func f[G any]() int {
	return func() int {
		return func() int {
			return 0
		}()
	}()
}

func main() {
	f[int]()
}
$ gotip tool compile -G=3 crash.go

crash.go:5:10: internal compiler error: misuse of CaptureName on closure variable: .dict

goroutine 1 [running]:
runtime/debug.Stack()
	/home/alberto/go/src/runtime/debug/stack.go:24 +0x65
cmd/compile/internal/base.FatalfAt({0x401ba0, 0xc0}, {0xd0af82, 0x2d}, {0xc000114240, 0x1, 0x1})
	/home/alberto/go/src/cmd/compile/internal/base/print.go:227 +0x154
cmd/compile/internal/ir.CaptureName({0x40b2c0, 0xc0}, 0xc000402f20, 0xc00040e680)
	/home/alberto/go/src/cmd/compile/internal/ir/name.go:408 +0x8d
cmd/compile/internal/noder.(*subster).node.func1({0xe5eb90, 0xc0003f7ea0})
	/home/alberto/go/src/cmd/compile/internal/noder/stencil.go:1077 +0x118c
cmd/compile/internal/ir.(*CallExpr).editChildren(0xc0001726c0, 0xc00000db30)
	/home/alberto/go/src/cmd/compile/internal/ir/node_gen.go:274 +0x58
cmd/compile/internal/ir.EditChildren(...)

cc @danscales @randall77

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions