Skip to content

Commit

Permalink
Update argument error message when matching with <> (#13325)
Browse files Browse the repository at this point in the history
* Update argument error message when matching with <>

* Update lib/elixir/lib/kernel.ex

Co-authored-by: José Valim <jose.valim@gmail.com>

---------

Co-authored-by: José Valim <jose.valim@gmail.com>
  • Loading branch information
sabiwara and josevalim committed Feb 9, 2024
1 parent 555eac7 commit 3fb82c3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/elixir/lib/kernel.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2082,8 +2082,9 @@ defmodule Kernel do
defp invalid_concat_left_argument_error(arg) do
:erlang.error(
ArgumentError.exception(
"the left argument of <> operator inside a match should always be a literal " <>
"binary because its size can't be verified. Got: #{arg}"
"cannot perform prefix match because the left operand of <> has unknown size. " <>
"The left operand of <> inside a match should either be a literal binary or " <>
"an existing variable with the pin operator (such as ^some_var). Got: #{arg}"
)
)
end
Expand Down

0 comments on commit 3fb82c3

Please sign in to comment.