Skip to content

Commit

Permalink
Merge pull request #14 from curiosum-dev/fix/12-delegator-nil-and-ato…
Browse files Browse the repository at this point in the history
…m-issue

Fixes issue with nil and atom value formatting in spec delegations
  • Loading branch information
szsoppa authored May 26, 2023
2 parents 0c39a36 + 7bc0610 commit 2493ec5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/contexted/module_analyzer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@ defmodule Contexted.ModuleAnalyzer do
Enum.map_join(types, " | ", &format_type/1)
end

defp format_type({:atom, _, atom}), do: atom |> Atom.to_string()
defp format_type({:atom, _, atom}), do: ":#{Atom.to_string(atom)}"
defp format_type({:type, _, type_name, _}), do: "#{type_name}()"

defp format_type({:remote_type, _, [{:atom, _, module}, {:atom, _, type}, []]}) do
defp format_type({:remote_type, _, [{:atom, _, module}, {:atom, _, type}, _list]}) do
if module == :elixir do
"#{type}()"
else
Expand Down

0 comments on commit 2493ec5

Please sign in to comment.