Skip to content

Commit 56ecdb1

Browse files
committed
Improve warnings
1 parent 7c8eb41 commit 56ecdb1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
#### Elixir
112112

113113
* [Kernel] Using `start..stop` to match on ranges is soft-deprecated and will warn on future Elixir versions. Use `start..stop//step` instead
114-
* [Kernel] Using `start..stop` to create decreasing ranges is soft-deprecated and will warn on future versions. However, note this will only warn if the right-side is a variable. For example, `1..-2` and `x..-1` won't warn, but `1..x` or `x..y` will
114+
* [Kernel] Using `start..stop` to create decreasing ranges is soft-deprecated and will warn on future versions. Use `start..stop//-1` instead
115115

116116
### 4. Hard-deprecations
117117

lib/elixir/src/elixir_parser.yrl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ build_op(AST, {_Kind, Location, '//'}, Right) ->
718718
{'..//', Meta, [Left, Middle, Right]};
719719

720720
_ ->
721-
return_error(meta_from_location(Location), "the range step operator (//) must immediately follow the range definition operator (..), for example: 1..9//2. Syntax error before: ", "'//'")
721+
return_error(meta_from_location(Location), "the range step operator (//) must immediately follow the range definition operator (..), for example: 1..9//2. If you wanted to define a default argument, use (\\\\) instead. Syntax error before: ", "'//'")
722722
end;
723723

724724
build_op({UOp, _, [Left]}, {_Kind, Location, 'in'}, Right) when ?rearrange_uop(UOp) ->

0 commit comments

Comments
 (0)