Fix MapSet.split_with/2 doctest predicate arity#15551
Merged
Merged
Conversation
Member
|
Let's change the example to not use an empty set perhaps? :) |
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 <nseaprotector@gmail.com>
ccabf41 to
68e3678
Compare
Contributor
Author
|
Good point! Updated to use a non-empty set so the predicate is actually exercised. Thanks a lot @josevalim you make my day! |
Member
|
💚 💙 💜 💛 ❤️ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The second doctest passed a two-element tuple pattern (
fn {_k, v} -> ... end) toMapSet.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 ofMap.split_with/2and 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