From 85e00cddd534528849ab1b89c46a3d592c695644 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Thu, 12 Dec 2024 09:52:27 +0100 Subject: [PATCH] Clarify warnings happen on compiled code --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7144620149..0770548868 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 @@ -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)