From fd77883a3fc0a68ca1701a5bfb12ec9b4934ef06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stanis=C5=82aw=20Barzowski?= Date: Fri, 4 Aug 2017 14:52:29 -0400 Subject: [PATCH] Fix local bind body not being desugared In Go `for i, val := range arr` creates a *copy* so it was changing some temporary value. --- desugarer.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/desugarer.go b/desugarer.go index d163ce5..34933f6 100644 --- a/desugarer.go +++ b/desugarer.go @@ -302,8 +302,8 @@ func desugar(astPtr *astNode, objLevel int) (err error) { return unimplErr case *astLocal: - for _, bind := range ast.binds { - err = desugar(&bind.body, objLevel) + for i := range ast.binds { + err = desugar(&ast.binds[i].body, objLevel) if err != nil { return }