Skip to content

Commit eb6231d

Browse files
committed
Improve spec and docs for Macro.underscore/1, closes #13739
1 parent 1e914b0 commit eb6231d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/elixir/lib/macro.ex

+3-4
Original file line numberDiff line numberDiff line change
@@ -2136,9 +2136,8 @@ defmodule Macro do
21362136
@doc """
21372137
Converts the given argument to a string with the underscore-slash format.
21382138
2139-
The argument must either be an atom or a string.
2140-
If an atom is given, it is assumed to be an Elixir module,
2141-
so it is converted to a string and then processed.
2139+
The argument must either be an atom, representing an Elixir module,
2140+
or a string representing a module without the `Elixir.` prefix.
21422141
21432142
This function was designed to format language identifiers/tokens with the underscore-slash format,
21442143
that's why it belongs to the `Macro` module. Do not use it as a general
@@ -2172,7 +2171,7 @@ defmodule Macro do
21722171
"Foo.Bar"
21732172
21742173
"""
2175-
@spec underscore(module() | atom() | String.t()) :: String.t()
2174+
@spec underscore(atom() | String.t()) :: String.t()
21762175
def underscore(atom_or_string)
21772176

21782177
def underscore(atom) when is_atom(atom) do

0 commit comments

Comments
 (0)