Skip to content

Commit 048cc2d

Browse files
woyliejosevalim
authored andcommitted
Further improve warning message for range with negative step (#14070)
1 parent 048ae58 commit 048cc2d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/elixir/lib/range.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ defmodule Range do
192192
IO.warn_once(
193193
{__MODULE__, :new},
194194
fn ->
195-
"Range.new/2 has a default step of -1 when last < first, please call Range.new/3 explicitly passing the step of -1 instead"
195+
"Range.new/2 and first..last default to a step of -1 when last < first. Use Range.new(first, last, -1) or first..last//-1, or pass 1 if that was your intention"
196196
end,
197197
3
198198
)

0 commit comments

Comments
 (0)