Skip to content

Commit 684acb9

Browse files
committed
Remove dynamic from stacktrace
1 parent c4301b6 commit 684acb9

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

lib/elixir/lib/module/types/apply.ex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -830,6 +830,7 @@ defmodule Module.Types.Apply do
830830

831831
message =
832832
case reason do
833+
# TODO: Return the domain here
833834
:badarg ->
834835
"""
835836
expected a #{length(args_types)}-arity function on call:

lib/elixir/lib/module/types/descr.ex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,11 +1000,11 @@ defmodule Module.Types.Descr do
10001000
end
10011001

10021002
# Optimize the cases where dynamic closes over all function types
1003-
# {:term, fun_static} when fun_static == %{} ->
1004-
# {:ok, dynamic()}
1003+
{:term, fun_static} when fun_static == %{} ->
1004+
{:ok, dynamic()}
10051005

1006-
# {%{fun: @fun_top}, fun_static} when fun_static == %{} ->
1007-
# {:ok, dynamic()}
1006+
{%{fun: @fun_top}, fun_static} when fun_static == %{} ->
1007+
{:ok, dynamic()}
10081008

10091009
{fun_dynamic, fun_static} ->
10101010
if fun_only?(fun_static) do

lib/elixir/lib/module/types/expr.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ defmodule Module.Types.Expr do
5151
@stacktrace list(
5252
union(
5353
tuple([atom(), atom(), args_or_arity, extra_info]),
54-
tuple([dynamic(fun()), args_or_arity, extra_info])
54+
tuple([fun(), args_or_arity, extra_info])
5555
)
5656
)
5757

@@ -449,10 +449,10 @@ defmodule Module.Types.Expr do
449449
{dynamic(), context}
450450
end
451451

452-
# TODO: fun.(args)
453452
def of_expr({{:., _, [fun]}, _, args} = call, _expected, _expr, stack, context) do
454453
{fun_type, context} = of_expr(fun, fun(length(args)), call, stack, context)
455454

455+
# TODO: Perform inference based on the strong domain of a function
456456
{args_types, context} =
457457
Enum.map_reduce(args, context, &of_expr(&1, @pending, &1, stack, &2))
458458

0 commit comments

Comments
 (0)