Skip to content

Commit 7e63560

Browse files
author
Brujo Benavides
authored
Merge pull request #62 from inaka/remove-discrepancies
Remove discrepancies. Thanks, dialyzer!
2 parents 1c7c5bb + 47e7d5f commit 7e63560

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

rebar.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
{dialyzer, [ {warnings, [ no_return
2929
, unmatched_returns
3030
, error_handling
31+
, underspecs
3132
]}
3233
, {plt_apps, top_level_deps}
3334
, {plt_extra_apps, [tools, syntax_tools]}

src/ktn_code.erl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ to_str(Arg) when is_list(Arg) ->
250250
%%% Internal
251251
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
252252

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

839-
-spec macro_name(any()) -> string().
839+
-spec macro_name(erl_syntax:syntaxTree()) -> string().
840840
macro_name(Name) ->
841841
case erl_syntax:type(Name) of
842842
atom ->
@@ -855,7 +855,7 @@ macro_name(Name) ->
855855
%% NOTE: Copied from ktn_lists not to bring the whole erlang-katana
856856
%% repo as a dependency here
857857
%% @end
858-
-spec split_when(fun(), list()) -> list().
858+
-spec split_when(fun((T) -> boolean()), [T]) -> [[T]].
859859
split_when(When, List) ->
860860
split_when(When, List, [[]]).
861861

src/ktn_io_string.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ do_get_line("\r" ++ RestStr, Result) ->
112112
do_get_line([Ch | RestStr], Result) ->
113113
do_get_line(RestStr, [Result, Ch]).
114114

115-
-spec get_until(module(), atom(), list(), term()) ->
115+
-spec get_until(module(), atom(), list(), eof | string()) ->
116116
{term(), string()}.
117117
get_until(Module, Function, XArgs, Str) ->
118118
apply_get_until(Module, Function, [], Str, XArgs).

0 commit comments

Comments
 (0)