diff options
author | Eric Meadows-Jönsson <eric.meadows.jonsson@gmail.com> | 2019-07-02 22:58:15 +0200 |
---|---|---|
committer | Eric Meadows-Jönsson <eric.meadows.jonsson@gmail.com> | 2019-07-02 23:10:32 +0200 |
commit | 02008263b276d8b9f8950942621b13456cded748 (patch) | |
tree | ace31a51e39727234a28bc45bdbbcfb0f111dcc8 | |
parent | 6edec0b7fcc67123da62c0f4ec24686db90cf6a1 (diff) | |
download | elixir-02008263b276d8b9f8950942621b13456cded748.tar.gz |
Revert "Fetch deprecation warnings from chunk"
This reverts commit 1b52a91cd27ea9388853e9aaddbbe9351f2864ba.
-rw-r--r-- | lib/elixir/lib/module/checker.ex | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/elixir/lib/module/checker.ex b/lib/elixir/lib/module/checker.ex index c4bb065ab..b8d4ca777 100644 --- a/lib/elixir/lib/module/checker.ex +++ b/lib/elixir/lib/module/checker.ex @@ -110,13 +110,13 @@ defmodule Module.Checker do end defp deprecated_reason(module, fun, arity) do - with {^module, binary, _path} <- :code.get_object_code(module), - {:ok, {^module, [{'ExDp', chunk}]}} <- :beam_lib.chunks(binary, ['ExDp']), - {:elixir_deprecated_v1, deprecated} <- :erlang.binary_to_term(chunk), - {_key, reason} <- List.keyfind(deprecated, {fun, arity}, 0) do - reason + if function_exported?(module, :__info__, 1) do + case List.keyfind(module.__info__(:deprecated), {fun, arity}, 0) do + {_key, reason} -> reason + nil -> nil + end else - _ -> nil + nil end end |