From cddd5e1f6d6e6128f05364745bf11e14d8712b07 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Tue, 30 Nov 2021 18:02:38 +0300 Subject: [PATCH] compiler: add a panic on internal lambda inconsistency It's a bit better than behavior observer in #2281 (which is very cryptic). --- pkg/compiler/codegen.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/compiler/codegen.go b/pkg/compiler/codegen.go index ab66620ed..b5cdc0480 100644 --- a/pkg/compiler/codegen.go +++ b/pkg/compiler/codegen.go @@ -514,6 +514,9 @@ func (c *codegen) convertFuncDecl(file ast.Node, decl *ast.FuncDecl, pkg *types. if !isLambda { for _, f := range c.lambda { + if _, ok := c.lambda[c.getIdentName("", f.decl.Name.Name)]; !ok { + panic("ICE: lambda name doesn't match map key") + } c.convertFuncDecl(file, f.decl, pkg) } c.lambda = make(map[string]*funcScope)