Skip to content

Commit

Permalink
Resolve missing range error. (#385)
Browse files Browse the repository at this point in the history
  • Loading branch information
asummers committed Mar 11, 2020
1 parent 96cdaac commit c1251b3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/dialyxir/warnings/missing_range.ex
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,17 @@ defmodule Dialyxir.Warnings.MissingRange do

@impl Dialyxir.Warning
@spec format_short([String.t()]) :: String.t()
def format_short([_module, function | _]) do
"The type specification is missing types returned by #{function}."
def format_short([module, function, arity | _]) do
pretty_module = Erlex.pretty_print(module)

"The type specification is missing types returned by #{pretty_module}.#{function}/#{arity}."
end

@impl Dialyxir.Warning
@spec format_long([String.t()]) :: String.t()
def format_long([module, function, arity, extra_ranges, contract_range]) do
pretty_module = Erlex.pretty_print(module)
pretty_contract_range = Erlex.pretty_print_contract(contract_range)
pretty_contract_range = Erlex.pretty_print_args(contract_range)
pretty_extra_ranges = Erlex.pretty_print_contract(extra_ranges)

"""
Expand All @@ -27,7 +29,7 @@ defmodule Dialyxir.Warnings.MissingRange do
Type specification return types:
#{pretty_contract_range}
Extra types in success typing:
Missing types:
#{pretty_extra_ranges}
"""
end
Expand Down

0 comments on commit c1251b3

Please sign in to comment.