Fix code gen of top-level cyclic values
Mutually recursive definitions may include tail-call definitions, so I
gotta handle that case too!
commita5a51963f6f2238f9e1c043eca6f4b154b1bddb7
authorEvan Czaplicki <evancz@users.noreply.github.com>
dateWed 31 Jan 2018, 14:05 (9 years ago)
parent9c1f88d
src/Optimize/Module.hs+1−1
@@ -352,7 +352,7 @@ addRecDef home dummyName cycle state@(State values graph) def =
352352 _ ->
353353 let
354354 (deps, fields, odef) =
355− Names.run (Expr.optimizePotentialTailCall Set.empty def)
355+ Names.run (Expr.optimizePotentialTailCall cycle def)
356356 in
357357 pure $ State values $
358358 case odef of