@@ -48,6 +48,9 @@ tco mn = everywhere convert where
4848 collectAllFunctionArgs :: [[Text]] -> (AST -> AST) -> AST -> ([[Text]], AST, AST -> AST)
4949 collectAllFunctionArgs allArgs f (Function s1 ident args (Block s2 (body@(Return _ _):_))) =
5050 collectAllFunctionArgs (args : allArgs) (\b -> f (Function s1 ident (map copyVar args) (Block s2 [b]))) body
51+ -- Handle RecLetDecl weak assignment case
52+ collectAllFunctionArgs allArgs f (Function s1 ident args (Block s2 (Var{}:body@(Return _ _):_))) =
53+ collectAllFunctionArgs (args : allArgs) (\b -> f (Function s1 ident (map copyVar args) (Block s2 [b]))) body
5154 collectAllFunctionArgs allArgs f (Function ss ident args body@(Block _ _)) =
5255 (args : allArgs, body, f . Function ss ident (map copyVar args))
5356 collectAllFunctionArgs allArgs f (Return s1 (Function s2 ident args (Block s3 [body]))) =