Skip to content

Commit 39d646f

Browse files
authored
Include sigils option in invalid import error message (#15334)
1 parent ad262dc commit 39d646f

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

lib/elixir/src/elixir_import.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ format_error({invalid_import, {Receiver, Name, Arity}}) ->
248248
[elixir_aliases:inspect(Receiver), Name, Arity]);
249249

250250
format_error({invalid_option, only, Value}) ->
251-
Message = "invalid :only option for import, expected value to be an atom :functions, :macros"
251+
Message = "invalid :only option for import, expected value to be an atom :functions, :macros, :sigils"
252252
", or a literal keyword list of function names with arity as values, got: ~s",
253253
io_lib:format(Message, ['Elixir.Macro':to_string(Value)]);
254254

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ defmodule Kernel.ErrorsTest do
698698
assert_compile_error(
699699
[
700700
"nofile:3:3",
701-
"invalid :only option for import, expected value to be an atom :functions, :macros, or a literal keyword list of function names with arity as values, got: x"
701+
"invalid :only option for import, expected value to be an atom :functions, :macros, :sigils, or a literal keyword list of function names with arity as values, got: x"
702702
],
703703
~c"""
704704
defmodule Kernel.ErrorsTest.Only do

lib/elixir/test/elixir/macro/env_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ defmodule Macro.EnvTest do
9797

9898
test "with errors" do
9999
message =
100-
"invalid :only option for import, expected value to be an atom :functions, :macros, " <>
100+
"invalid :only option for import, expected value to be an atom :functions, :macros, :sigils, " <>
101101
"or a literal keyword list of function names with arity as values, got: "
102102

103103
assert define_import(env(), meta(), Integer, only: :unknown) ==

0 commit comments

Comments
 (0)