Skip to content

Commit

Permalink
Merge pull request #62 from inaka/remove-discrepancies
Browse files Browse the repository at this point in the history
Remove discrepancies. Thanks, dialyzer!
  • Loading branch information
Brujo Benavides authored Feb 23, 2021
2 parents 1c7c5bb + 47e7d5f commit 7e63560
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
{dialyzer, [ {warnings, [ no_return
, unmatched_returns
, error_handling
, underspecs
]}
, {plt_apps, top_level_deps}
, {plt_extra_apps, [tools, syntax_tools]}
Expand Down
6 changes: 3 additions & 3 deletions src/ktn_code.erl
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ to_str(Arg) when is_list(Arg) ->
%%% Internal
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

-spec source_encoding(binary() | list()) -> latin1 | utf8.
-spec source_encoding(binary()) -> latin1 | utf8.
source_encoding(Source) ->
Re = ".*\n?.*(coding *[:=] *(?<encoding>[-a-zA-Z0-9]+))",
ReOpts = [firstline, {capture, all_names, list}],
Expand Down Expand Up @@ -836,7 +836,7 @@ to_map(Parsed) when is_tuple(Parsed) ->
to_map(Parsed) ->
throw({unexpected_abstract_form, Parsed}).

-spec macro_name(any()) -> string().
-spec macro_name(erl_syntax:syntaxTree()) -> string().
macro_name(Name) ->
case erl_syntax:type(Name) of
atom ->
Expand All @@ -855,7 +855,7 @@ macro_name(Name) ->
%% NOTE: Copied from ktn_lists not to bring the whole erlang-katana
%% repo as a dependency here
%% @end
-spec split_when(fun(), list()) -> list().
-spec split_when(fun((T) -> boolean()), [T]) -> [[T]].
split_when(When, List) ->
split_when(When, List, [[]]).

Expand Down
2 changes: 1 addition & 1 deletion src/ktn_io_string.erl
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ do_get_line("\r" ++ RestStr, Result) ->
do_get_line([Ch | RestStr], Result) ->
do_get_line(RestStr, [Result, Ch]).

-spec get_until(module(), atom(), list(), term()) ->
-spec get_until(module(), atom(), list(), eof | string()) ->
{term(), string()}.
get_until(Module, Function, XArgs, Str) ->
apply_get_until(Module, Function, [], Str, XArgs).
Expand Down

0 comments on commit 7e63560

Please sign in to comment.