Skip to content

Commit d3fb79e

Browse files
adkronJosé Valim
authored and
José Valim
committed
Clarify invalid pattern in match error
It was pointed out that `invalid expression in match` was unclear because the "expression" that is referred to should is not actually an expression. Since `case` can only match against a pattern it is clearer to say `invalid pattern in match`. Addresses Issue #5649 Amos King @adkron <[email protected]> Signed-off-by: José Valim <[email protected]>
1 parent dbf6250 commit d3fb79e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/elixir/src/elixir_exp.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ assert_no_match_or_guard_scope(Meta, Kind, E) ->
684684
assert_no_match_scope(Meta, Kind, E),
685685
assert_no_guard_scope(Meta, Kind, E).
686686
assert_no_match_scope(Meta, _Kind, #{context := match, file := File}) ->
687-
compile_error(Meta, File, "invalid expression in match");
687+
compile_error(Meta, File, "invalid pattern in match");
688688
assert_no_match_scope(_Meta, _Kind, _E) -> [].
689689
assert_no_guard_scope(Meta, _Kind, #{context := guard, file := File}) ->
690690
compile_error(Meta, File, "invalid expression in guard");

lib/elixir/test/elixir/kernel/errors_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ defmodule Kernel.ErrorsTest do
223223

224224
test "invalid match pattern" do
225225
assert_compile_fail CompileError,
226-
"nofile:2: invalid expression in match",
226+
"nofile:2: invalid pattern in match",
227227
'''
228228
case true do
229229
true && true -> true

0 commit comments

Comments
 (0)