From 5fa39adb813895e2bd68020dad315a49aea13537 Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Sun, 3 Jun 2018 17:45:33 +0200 Subject: [PATCH] tgo: Allow anonymous function declarations Not sure why they're needed right now, though... --- tgo.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tgo.go b/tgo.go index 3cdfb292..16152b3a 100644 --- a/tgo.go +++ b/tgo.go @@ -392,6 +392,14 @@ func (c *Compiler) parsePackage(program *ssa.Program, pkg *ssa.Package) error { if member.Synthetic == "package initializer" { c.initFuncs = append(c.initFuncs, frame.llvmFn) } + // TODO: recursively anonymous functions + for _, child := range member.AnonFuncs { + frame, err := c.parseFuncDecl(child) + if err != nil { + return err + } + frames[child] = frame + } case *ssa.NamedConst: // Ignore package-level untyped constants. The SSA form doesn't need // them.