diff --git a/lib/process_tree.ex b/lib/process_tree.ex index 9e340c9..6ccf70b 100644 --- a/lib/process_tree.ex +++ b/lib/process_tree.ex @@ -31,7 +31,7 @@ defmodule ProcessTree do Returns the first non-nil value found in the tree. If no value is found, returns `nil`. """ - @spec get(term()) :: any() + @spec get(term()) :: term() def get(key) do case Process.get(key) do nil -> @@ -63,7 +63,7 @@ defmodule ProcessTree do value = ProcessTree.get(:some_key, default: default_value) ``` """ - @spec get(term(), default: any()) :: any() + @spec get(term(), default: term()) :: term() def get(key, default: default_value) do case get(key) do nil -> @@ -200,7 +200,7 @@ defmodule ProcessTree do defp process_info_parent(_pid), do: nil end - @spec ancestor_value(any(), id(), [id()]) :: any() + @spec ancestor_value(term(), id(), [id()]) :: term() defp ancestor_value(key, pid_or_name, dictionary_ancestors) do cond do (value = get_dictionary_value(pid_or_name, key)) != nil -> @@ -220,7 +220,7 @@ defmodule ProcessTree do end end - @spec get_dictionary_value(id(), atom()) :: any() + @spec get_dictionary_value(id(), atom()) :: term() defp get_dictionary_value(nil, _key), do: nil defp get_dictionary_value(name, _key) when is_atom(name) do