Skip to content

Commit 10f9b78

Browse files
author
José Valim
committed
Make sure put_attribute still returns a quoted expression
Signed-off-by: José Valim <jose.valim@plataformatec.com.br>
1 parent eb8c734 commit 10f9b78

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

lib/elixir/lib/calendar.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ defmodule Calendar do
9090
@callback date_to_string(year, month, day) :: String.t
9191

9292
@doc """
93-
Coverts the date time (without time zone) into a string according to the calendar.
93+
Converts the date time (without time zone) into a string according to the calendar.
9494
"""
9595
@callback naive_datetime_to_string(year, month, day, hour, minute, second, microsecond) :: String.t
9696

lib/elixir/lib/module.ex

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -843,16 +843,14 @@ defmodule Module do
843843
@doc """
844844
Puts a module attribute with key and value in the given module.
845845
846-
It returns the value of the attribute after normalization.
847-
848846
## Examples
849847
850848
defmodule MyModule do
851849
Module.put_attribute __MODULE__, :custom_threshold_for_lib, 10
852850
end
853851
854852
"""
855-
@spec put_attribute(module, key :: atom, value :: term) :: term
853+
@spec put_attribute(module, key :: atom, value :: term) :: :ok
856854
def put_attribute(module, key, value) do
857855
put_attribute(module, key, value, nil, nil)
858856
end
@@ -920,9 +918,10 @@ defmodule Module do
920918
end
921919

922920
@doc """
923-
Registers an attribute. By registering an attribute, a developer
924-
is able to customize how Elixir will store and accumulate the
925-
attribute values.
921+
Registers an attribute.
922+
923+
By registering an attribute, a developer is able to customize
924+
how Elixir will store and accumulate the attribute values.
926925
927926
## Options
928927
@@ -1076,7 +1075,7 @@ defmodule Module do
10761075
:ets.insert(table, {key, value, false, unread_line})
10771076
end
10781077

1079-
value
1078+
:ok
10801079
end
10811080

10821081
## Helpers

lib/elixir/test/elixir/module_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ defmodule ModuleTest do
6060

6161
test "module attributes returns value" do
6262
in_module do
63-
assert (@return [:foo, :bar]) == [:foo, :bar]
63+
assert (@return [:foo, :bar]) == :ok
6464
_ = @return
6565
end
6666
end

0 commit comments

Comments
 (0)