diff --git a/lib/compiler/Phases.ml b/lib/compiler/Phases.ml index 9d950fc..ff50db8 100644 --- a/lib/compiler/Phases.ml +++ b/lib/compiler/Phases.ml @@ -379,11 +379,14 @@ let implant ~(forest : State.t) (foreign : Config.foreign) = let implant_foreign ~(forest : State.t) : _ = let total = List.length forest.config.foreign in - forest.log.debug ~src:Log.Src.compiler (fun m -> - m "implanting %i foreign forests" total); - let@ foreign = - Eio.Fiber.List.filter_map ~max_fibers @~ forest.config.foreign - in - implant ~forest foreign |> function Ok () -> None | Error e -> Some e + if total = 0 then [] + else begin + forest.log.debug ~src:Log.Src.compiler (fun m -> + m "implanting %i foreign forests" total); + let@ foreign = + Eio.Fiber.List.filter_map ~max_fibers @~ forest.config.foreign + in + implant ~forest foreign |> function Ok () -> None | Error e -> Some e + end let render _forest = []