Skip to content

Commit

Permalink
Clarify warnings happen on compiled code
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Dec 12, 2024
1 parent 6c866e8 commit 85e00cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Elixir v1.18 is an impressive release with improvements across the two main effo

## Type system improvements

The most exciting change in Elixir v1.18 is type checking of function calls, alongside gradual inference of patterns and return types. To understand how this will impact your programs, consider the following code:
The most exciting change in Elixir v1.18 is type checking of function calls, alongside gradual inference of patterns and return types. To understand how this will impact your programs, consider the following code in "lib/user.ex":

```elixir
defmodule User do
Expand All @@ -26,7 +26,7 @@ end

Elixir's type system will infer that the `drive/2` function expects a `%User{}` struct and returns either `{:ok, dynamic()}`, `{:error, :no_choice}`, or `{:error, :not_allowed}`.

Therefore, the following code should emit a violation, due to an invalid argument:
Therefore, the following code in a separate module (either in a separate or the same file), should emit a violation, due to an invalid argument:

```elixir
User.drive({:ok, %User{}}, car_choices)
Expand Down

0 comments on commit 85e00cd

Please sign in to comment.