Skip to content

Commit 939c108

Browse files
chore(deps): update dependency erlang to v28 (#293)
* chore(deps): update dependency erlang to v28 * fix: avoid `MapSet` opaque type in recursive accumulator for OTP 28 dialyzer Accumulate step names into a plain list and convert to `MapSet` at the end, avoiding OTP 28's stricter opaque type checking in the recursive `collect_all_step_names` function. --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: James Harton <james@harton.nz>
1 parent b040e3a commit 939c108

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
erlang 27.3.4
1+
erlang 28.3.1
22
elixir 1.18.4
33
pipx 1.8.0

lib/reactor/step/map.ex

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -175,16 +175,21 @@ defmodule Reactor.Step.Map do
175175
emit_batch(source, options, map_step, result)
176176
end
177177

178-
defp collect_all_step_names(steps, into \\ MapSet.new())
179-
defp collect_all_step_names([], into), do: into
178+
defp collect_all_step_names(steps) do
179+
steps
180+
|> do_collect_all_step_names([])
181+
|> MapSet.new()
182+
end
183+
184+
defp do_collect_all_step_names([], acc), do: acc
180185

181-
defp collect_all_step_names([%{steps: [_ | _] = child_steps} = step | steps], into) do
182-
into = collect_all_step_names(child_steps, MapSet.put(into, step.name))
183-
collect_all_step_names(steps, into)
186+
defp do_collect_all_step_names([%{steps: [_ | _] = child_steps} = step | steps], acc) do
187+
acc = do_collect_all_step_names(child_steps, [step.name | acc])
188+
do_collect_all_step_names(steps, acc)
184189
end
185190

186-
defp collect_all_step_names([step | steps], into),
187-
do: collect_all_step_names(steps, MapSet.put(into, step.name))
191+
defp do_collect_all_step_names([step | steps], acc),
192+
do: do_collect_all_step_names(steps, [step.name | acc])
188193

189194
defp emit_batch(source, options, map_step, result) do
190195
with {:done, batch} <- Iter.take_chunk(source, options[:batch_size]),

0 commit comments

Comments
 (0)