From f2ff3a7a868c5b0d2fd2b3f497c330e9df80c3f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Sat, 10 Jan 2026 19:53:21 +0100 Subject: [PATCH] More docs --- lib/elixir/lib/module/types/apply.ex | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/elixir/lib/module/types/apply.ex b/lib/elixir/lib/module/types/apply.ex index e5a853e04d..06531d2e22 100644 --- a/lib/elixir/lib/module/types/apply.ex +++ b/lib/elixir/lib/module/types/apply.ex @@ -1328,6 +1328,9 @@ defmodule Module.Types.Apply do Computes the return type of an application. """ def return(type, args_types, stack) do + # An argument being gradual does not imply the return type + # is gradual in static mode. However, we do wrap in dynamic + # in :dynamic / :gradual mode to avoid false positives. cond do stack.mode == :static -> type Enum.any?(args_types, &gradual?/1) -> dynamic(type)