Do not crash when checking empty receive

This commit is contained in:
José Valim
2020-05-22 10:58:12 +02:00
parent 50995e6640
commit 44061c8499
2 changed files with 12 additions and 0 deletions
+3
View File
@@ -264,6 +264,9 @@ defmodule Module.Types.Expr do
result =
each_ok(blocks, fn
{:do, {:__block__, _, []}} ->
:ok
{:do, clauses} ->
of_clauses(clauses, stack, context)
@@ -288,6 +288,15 @@ defmodule Module.Types.ExprTest do
assert {:error, _} = quoted_expr(fn :foo = b -> :bar = b end)
end
test "receive" do
assert quoted_expr(
receive do
after
0 -> :ok
end
) == {:ok, :dynamic}
end
test "with" do
assert quoted_expr(
[a, b],