From 68e3678154e9952d60f4c84fb4aa99827291e2bf Mon Sep 17 00:00:00 2001 From: nseaSeb Date: Wed, 8 Jul 2026 09:56:05 +0200 Subject: [PATCH] Fix `MapSet.split_with/2` doctest predicate arity MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The second doctest passed a two-element tuple pattern (`fn {_k, v} -> ... end`) to `MapSet.split_with/2`, but the predicate receives each set element as its only argument — as the docstring states and the first doctest and implementation (`fun.(key)`) confirm. The wrong form was a copy of `Map.split_with/2` and only went unnoticed because the example uses an empty set, so the predicate is never called. Aligns it with the documented arity. Assisted-by: Claude Code:claude-opus-4-8 Signed-off-by: nseaSeb --- lib/elixir/lib/map_set.ex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/elixir/lib/map_set.ex b/lib/elixir/lib/map_set.ex index 4bb4269a1e..ab46ec5d81 100644 --- a/lib/elixir/lib/map_set.ex +++ b/lib/elixir/lib/map_set.ex @@ -396,11 +396,11 @@ defmodule MapSet do iex> while_false MapSet.new([1, 3]) - iex> {while_true, while_false} = MapSet.split_with(MapSet.new(), fn {_k, v} -> v > 50 end) + iex> {while_true, while_false} = MapSet.split_with(MapSet.new([10, 20, 60, 70]), fn v -> v > 50 end) iex> while_true - MapSet.new([]) + MapSet.new([60, 70]) iex> while_false - MapSet.new([]) + MapSet.new([10, 20]) """ @doc since: "1.15.0"