Skip to content

Commit 7307f3c

Browse files
committed
More tests for function application
1 parent 2f9be83 commit 7307f3c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/elixir/test/elixir/module/types/descr_test.exs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,12 @@ defmodule Module.Types.DescrTest do
849849
fun0 = intersection(fun([integer()], atom()), fun([float()], binary()))
850850
assert fun_apply(fun0, [integer()]) == {:ok, atom()}
851851
assert fun_apply(fun0, [float()]) == {:ok, binary()}
852-
assert fun_apply(fun0, [union(integer(), float())]) == {:ok, union(atom(), binary())}
852+
assert fun_apply(fun0, [number()]) == {:ok, union(atom(), binary())}
853+
854+
assert fun_apply(fun0, [dynamic(integer())]) |> elem(1) |> equal?(atom())
855+
assert fun_apply(fun0, [dynamic(float())]) |> elem(1) |> equal?(binary())
856+
assert fun_apply(fun0, [dynamic(number())]) |> elem(1) |> equal?(union(atom(), binary()))
857+
assert fun_apply(fun0, [dynamic()]) == {:ok, dynamic()}
853858

854859
# Function intersection tests (overlap)
855860
fun1 = intersection(fun([integer()], atom()), fun([number()], term()))

0 commit comments

Comments
 (0)