fix(xref): raise on --min-cycle-label <= 0#15027
Merged
Merged
Conversation
Provides an error message in favor of
```
mix xref graph --format cycles --min-cycle-label 0 --label compile-connected
** (FunctionClauseError) no function clause matching in Enum.count_until/3
The following arguments were given to Enum.count_until/3:
# 1
[{"lib/foo.ex", nil}, {"lib/bar.ex", nil}]
# 2
#Function<4.83728021/1 in Mix.Tasks.Xref.cycle_filter_fn/1>
# 3
0
Attempted function clauses (showing 1 out of 1):
def count_until(enumerable, fun, limit) when is_integer(limit) and limit > 0
(elixir 1.19.4) lib/enum.ex:783: Enum.count_until/3
(mix 1.19.4) lib/mix/tasks/xref.ex:1247: anonymous fn/3 in Mi
```
davydog187
added a commit
to davydog187/elixir
that referenced
this pull request
Dec 30, 2025
As a follow up to elixir-lang#15027, provide a nicer error message when invoking `Enum.count_until` with an invalid limit
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.
Provides an error message in favor of