Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions lib/elixir/lib/module/types/descr.ex
Original file line number Diff line number Diff line change
Expand Up @@ -1434,15 +1434,16 @@ defmodule Module.Types.Descr do
# applying dynamic arrows to upper-bounded arguments in dynamic().
# - Mixed: union the static result with the dynamic-wrapped dynamic result.
defp fun_apply_with_strategy(fun_static, fun_dynamic, arguments) do
args_domain = args_to_domain(arguments)
static? = fun_dynamic == nil and Enum.all?(arguments, fn arg -> not gradual?(arg) end)
arity = length(arguments)

if Enum.any?(arguments, &empty?/1) do
{:badarg, arguments, true}
else
arity = length(arguments)

with {:ok, domain, static_arrows, dynamic_arrows} <-
fun_normalize_both(fun_static, fun_dynamic, arity) do
args_domain = args_to_domain(arguments)
static? = fun_dynamic == nil and Enum.all?(arguments, fn arg -> not gradual?(arg) end)

cond do
# The domain here is the extended gradual domain computed by
# fun_normalize_both/3. If the argument does not satisfy it, we
Expand Down
Loading