Skip to content

Commit baa7b5e

Browse files
committed
Revert "Remove unnecessary case annotations"
This reverts commit ecb4613.
1 parent 30764fe commit baa7b5e

File tree

1 file changed

+20
-14
lines changed

1 file changed

+20
-14
lines changed

lib/elixir/lib/kernel.ex

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4230,15 +4230,18 @@ defmodule Kernel do
42304230
defmacro left && right do
42314231
assert_no_match_or_guard_scope(__CALLER__.context, "&&")
42324232

4233-
quote do
4234-
case unquote(left) do
4235-
x when :"Elixir.Kernel".in(x, [false, nil]) ->
4236-
x
4233+
annotate_case(
4234+
[type_check: :expr],
4235+
quote do
4236+
case unquote(left) do
4237+
x when :"Elixir.Kernel".in(x, [false, nil]) ->
4238+
x
42374239

4238-
_ ->
4239-
unquote(right)
4240+
_ ->
4241+
unquote(right)
4242+
end
42404243
end
4241-
end
4244+
)
42424245
end
42434246

42444247
@doc """
@@ -4270,15 +4273,18 @@ defmodule Kernel do
42704273
defmacro left || right do
42714274
assert_no_match_or_guard_scope(__CALLER__.context, "||")
42724275

4273-
quote do
4274-
case unquote(left) do
4275-
x when :"Elixir.Kernel".in(x, [false, nil]) ->
4276-
unquote(right)
4276+
annotate_case(
4277+
[type_check: :expr],
4278+
quote do
4279+
case unquote(left) do
4280+
x when :"Elixir.Kernel".in(x, [false, nil]) ->
4281+
unquote(right)
42774282

4278-
x ->
4279-
x
4283+
x ->
4284+
x
4285+
end
42804286
end
4281-
end
4287+
)
42824288
end
42834289

42844290
@doc """

0 commit comments

Comments
 (0)