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)