diff options
author | Kostis Sagonas <[email protected]> | 2011-02-10 10:40:28 +0200 |
---|---|---|
committer | Kostis Sagonas <[email protected]> | 2011-02-10 10:40:28 +0200 |
commit | 4d7ada26e135a633b469ce6250b47d4210472a2c (patch) | |
tree | 98e015f11768b54042ca2ab774bb8557261c0047 /lib | |
parent | 179fff827985bc314f2a4cc953d66cdfebb05a57 (diff) | |
download | otp-4d7ada26e135a633b469ce6250b47d4210472a2c.tar.gz otp-4d7ada26e135a633b469ce6250b47d4210472a2c.tar.bz2 otp-4d7ada26e135a633b469ce6250b47d4210472a2c.zip |
Strengthen some specs
Diffstat (limited to 'lib')
-rw-r--r-- | lib/typer/src/typer.erl | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/typer/src/typer.erl b/lib/typer/src/typer.erl index 8955ebe4aa..fc8caa4f21 100644 --- a/lib/typer/src/typer.erl +++ b/lib/typer/src/typer.erl @@ -216,6 +216,7 @@ get_external(Exts, Plt) -> -define(TYPER_ANN_DIR, "typer_ann"). -type line() :: non_neg_integer(). +-type fa() :: {atom(), arity()}. -type func_info() :: {line(), atom(), arity()}. -record(info, {records = map__new() :: map(), @@ -677,7 +678,7 @@ analyze_result(no_spec, Args, Analysis) -> %% File processing. %%-------------------------------------------------------------------- --spec get_all_files(args()) -> files(). +-spec get_all_files(args()) -> [file:filename(),...]. get_all_files(#args{files = Fs, files_r = Ds}) -> case filter_fd(Fs, Ds, fun test_erl_file_exclude_ann/1) of @@ -1068,6 +1069,7 @@ rcv_ext_types(Self, ExtTypes) -> %%-------------------------------------------------------------------- %% A convenient abstraction of a Key-Value mapping data structure +%% specialized for the uses in this module %%-------------------------------------------------------------------- -type map() :: dict(). @@ -1085,7 +1087,7 @@ map__insert(Object, Map) -> map__lookup(Key, Map) -> try dict:fetch(Key, Map) catch error:_ -> none end. --spec map__from_list([{term(), term()}]) -> map(). +-spec map__from_list([{fa(), term()}]) -> map(). map__from_list(List) -> dict:from_list(List). @@ -1093,6 +1095,6 @@ map__from_list(List) -> map__remove(Key, Dict) -> dict:erase(Key, Dict). --spec map__fold(fun((term(), term(), term()) -> term()), term(), map()) -> term(). +-spec map__fold(fun((term(), term(), term()) -> map()), map(), map()) -> map(). map__fold(Fun, Acc0, Dict) -> dict:fold(Fun, Acc0, Dict). |