compiler: add a panic on internal lambda inconsistency

It's a bit better than behavior observer in #2281 (which is very cryptic).
This commit is contained in:
Roman Khimov 2021-11-30 18:02:38 +03:00
parent 33e37e60e5
commit cddd5e1f6d

View file

@ -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)