diff options
author | Björn Gustavsson <[email protected]> | 2018-10-19 05:52:19 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2018-10-19 13:02:36 +0200 |
commit | 131ff5fac7da80fe8080425182bf29f673ab301c (patch) | |
tree | fd41df896e19e02833b5b850961955f7865b8f87 /HOWTO | |
parent | 31562b636b1c89595c2bb4bb81bc7f781e6bd269 (diff) | |
download | otp-131ff5fac7da80fe8080425182bf29f673ab301c.tar.gz otp-131ff5fac7da80fe8080425182bf29f673ab301c.tar.bz2 otp-131ff5fac7da80fe8080425182bf29f673ab301c.zip |
beam_lib: Remove obsolete module() from the beam() type
The type `beam()` in the `beam_lib` module is confusing:
-type beam() :: module() | file:filename() | binary().
It says that the module name can be used to identify the BEAM module
to be accessed, but passing in the module name only works if the BEAM
file is located in the current working directory because the module
is not searched for in the code path.
The reason that it is allowed to pass in the module name as an atom is
for backward compatibility. A long time ago, atoms instead of strings
were used as filenames. For that reason, `filename` and `file` still
accept atoms as filenames (although the practice is frown
upon). `beam_lib` accepts an atom as the filename for the same reason.
To remove the confusion, remove `module()` from the type and the
mention of it in the documentation. Code that uses an atom as a
filename will still work, but Dialyzer will issue a warning.
https://bugs.erlang.org/browse/ERL-696
Diffstat (limited to 'HOWTO')
0 files changed, 0 insertions, 0 deletions