aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/src/code.erl
diff options
context:
space:
mode:
authorKostis Sagonas <[email protected]>2010-11-29 01:51:03 +0200
committerKostis Sagonas <[email protected]>2010-11-29 01:51:03 +0200
commit29c23e32a9154ef2feb6a6424647e749ce9acab1 (patch)
tree8c0cc25e0d7b4cb10b5e4a1830aa88313ff000c6 /lib/kernel/src/code.erl
parent4101091756a98d78cde0d6b2d88959dae324e860 (diff)
downloadotp-29c23e32a9154ef2feb6a6424647e749ce9acab1.tar.gz
otp-29c23e32a9154ef2feb6a6424647e749ce9acab1.tar.bz2
otp-29c23e32a9154ef2feb6a6424647e749ce9acab1.zip
Fix type information of 'file' and 'code' modules
Dialyzer for a long time now has had hard-coded type information about key functions of the 'file' and 'code' modules in 'erl_bif_types'. Some of this information was not up-to-date according to the published Erlang/OTP documentation, while some other part contained small errors. Now that specs are available, this information should be moved to the corresponding files, not be hard-coded in erl_bif_types. This change takes out all information for the 'file' module and fixes some small errors in type information for the 'code' module.
Diffstat (limited to 'lib/kernel/src/code.erl')
-rw-r--r--lib/kernel/src/code.erl10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/kernel/src/code.erl b/lib/kernel/src/code.erl
index ec256d5806..515ecd636f 100644
--- a/lib/kernel/src/code.erl
+++ b/lib/kernel/src/code.erl
@@ -213,19 +213,20 @@ unstick_mod(Mod) when is_atom(Mod) -> call({unstick_mod,Mod}).
-spec is_sticky(Module :: atom()) -> boolean().
is_sticky(Mod) when is_atom(Mod) -> call({is_sticky,Mod}).
--spec set_path(Directories :: [file:filename()]) -> 'true' | {'error', term()}.
+-spec set_path(Directories :: [file:filename()]) ->
+ 'true' | {'error', 'bad_directory' | 'bad_path'}.
set_path(PathList) when is_list(PathList) -> call({set_path,PathList}).
-spec get_path() -> [file:filename()].
get_path() -> call(get_path).
--spec add_path(Directory :: file:filename()) -> 'true' | {'error', term()}.
+-spec add_path(Directory :: file:filename()) -> 'true' | {'error', 'bad_directory'}.
add_path(Dir) when is_list(Dir) -> call({add_path,last,Dir}).
--spec add_pathz(Directory :: file:filename()) -> 'true' | {'error', term()}.
+-spec add_pathz(Directory :: file:filename()) -> 'true' | {'error', 'bad_directory'}.
add_pathz(Dir) when is_list(Dir) -> call({add_path,last,Dir}).
--spec add_patha(Directory :: file:filename()) -> 'true' | {'error', term()}.
+-spec add_patha(Directory :: file:filename()) -> 'true' | {'error', 'bad_directory'}.
add_patha(Dir) when is_list(Dir) -> call({add_path,first,Dir}).
-spec add_paths(Directories :: [file:filename()]) -> 'ok'.
@@ -237,7 +238,6 @@ add_pathsz(Dirs) when is_list(Dirs) -> call({add_paths,last,Dirs}).
-spec add_pathsa(Directories :: [file:filename()]) -> 'ok'.
add_pathsa(Dirs) when is_list(Dirs) -> call({add_paths,first,Dirs}).
-%% XXX Contract's input argument differs from add_path/1 -- why?
-spec del_path(Name :: file:filename() | atom()) -> boolean() | {'error', 'bad_name'}.
del_path(Name) when is_list(Name) ; is_atom(Name) -> call({del_path,Name}).