summaryrefslogtreecommitdiff
path: root/lib/elixir
diff options
context:
space:
mode:
Diffstat (limited to 'lib/elixir')
-rw-r--r--lib/elixir/lib/module/checker.ex4
-rw-r--r--lib/elixir/lib/module/parallel_checker.ex6
-rw-r--r--lib/elixir/test/elixir/module/checker_test.exs10
-rw-r--r--lib/elixir/test/elixir/protocol/consolidation_test.exs4
4 files changed, 12 insertions, 12 deletions
diff --git a/lib/elixir/lib/module/checker.ex b/lib/elixir/lib/module/checker.ex
index bf0877028..b6caa18fb 100644
--- a/lib/elixir/lib/module/checker.ex
+++ b/lib/elixir/lib/module/checker.ex
@@ -20,13 +20,13 @@ defmodule Module.Checker do
exports = ParallelChecker.definitions_to_exports(module_map.definitions)
deprecated = :maps.from_list(module_map.deprecated)
- map =
+ contents =
Enum.map(exports, fn {function, kind} ->
reason = :maps.get(function, deprecated, nil)
{function, {kind, reason}}
end)
- {'ExCk', :erlang.term_to_binary({:elixir_checker_v1, :maps.from_list(map)})}
+ {'ExCk', :erlang.term_to_binary({:elixir_checker_v1, Enum.sort(contents)})}
end
defp warnings(module_map, cache) do
diff --git a/lib/elixir/lib/module/parallel_checker.ex b/lib/elixir/lib/module/parallel_checker.ex
index e3ffb83d4..1096b0a89 100644
--- a/lib/elixir/lib/module/parallel_checker.ex
+++ b/lib/elixir/lib/module/parallel_checker.ex
@@ -197,8 +197,8 @@ defmodule Module.ParallelChecker do
defp cache_from_chunk(ets, module) do
with {^module, binary, _filename} <- :code.get_object_code(module),
{:ok, chunk} <- get_chunk(binary),
- {:elixir_checker_v1, map} <- :erlang.binary_to_term(chunk) do
- cache_chunk_map(ets, module, map)
+ {:elixir_checker_v1, contents} <- :erlang.binary_to_term(chunk) do
+ cache_chunk(ets, module, contents)
true
else
_ -> false
@@ -254,7 +254,7 @@ defmodule Module.ParallelChecker do
:ets.insert(ets, {{:cached, module}, true})
end
- defp cache_chunk_map(ets, module, exports) do
+ defp cache_chunk(ets, module, exports) do
exports =
Enum.map(exports, fn {{fun, arity}, {kind, deprecated}} ->
:ets.insert(ets, {{:export, {module, fun, arity}}, kind, deprecated})
diff --git a/lib/elixir/test/elixir/module/checker_test.exs b/lib/elixir/test/elixir/module/checker_test.exs
index e7f4350b8..fc27a518c 100644
--- a/lib/elixir/test/elixir/module/checker_test.exs
+++ b/lib/elixir/test/elixir/module/checker_test.exs
@@ -29,11 +29,11 @@ defmodule Module.CheckerTest do
modules = compile(files)
map = read_chunk(modules[A])
- assert map == %{
- {:c, 0} => {:def, nil},
- {:d, 0} => {:defmacro, nil},
- {:e, 0} => {:def, "oops"}
- }
+ assert map == [
+ {{:c, 0}, {:def, nil}},
+ {{:d, 0}, {:defmacro, nil}},
+ {{:e, 0}, {:def, "oops"}}
+ ]
end
end
diff --git a/lib/elixir/test/elixir/protocol/consolidation_test.exs b/lib/elixir/test/elixir/protocol/consolidation_test.exs
index 60f1c1aed..ac2b1adfa 100644
--- a/lib/elixir/test/elixir/protocol/consolidation_test.exs
+++ b/lib/elixir/test/elixir/protocol/consolidation_test.exs
@@ -116,8 +116,8 @@ defmodule Protocol.ConsolidationTest do
assert deprecated == Sample.__info__(:deprecated)
{:ok, {Sample, [{'ExCk', check_bin}]}} = :beam_lib.chunks(@sample_binary, ['ExCk'])
- assert {:elixir_checker_v1, map} = :erlang.binary_to_term(check_bin)
- assert %{{:ok, 1} => {:def, "Reason"}} = map
+ assert {:elixir_checker_v1, exports} = :erlang.binary_to_term(check_bin)
+ assert {{:ok, 1}, {:def, "Reason"}} in exports
end
test "consolidation keeps source" do