Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0cff7ec

Browse files
iascijosevalim
authored andcommitted
Providing a non-boolean will raise a BadBooleanError (elixir-lang#940)
Since 1.4 it will raise BadBooleanError instead of ArgumentError. See the following links: - https://github.com/elixir-lang/elixir/releases/tag/v1.4.0 - elixir-lang/elixir@6b8db41
1 parent e346aff commit 0cff7ec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

getting-started/basic-operators.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Providing a non-boolean will raise an exception:
3838

3939
```iex
4040
iex> 1 and true
41-
** (ArgumentError) argument error: 1
41+
** (BadBooleanError) expected a boolean on left-side of "and", got: 1
4242
```
4343

4444
`or` and `and` are short-circuit operators. They only execute the right side if the left side is not enough to determine the result:

0 commit comments

Comments
 (0)