aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2016-06-30 10:34:12 +0200
committerBjörn Gustavsson <[email protected]>2016-06-30 10:34:12 +0200
commit2b34c1fb98053b3cff3cfb38f9e9c2c94405eb3f (patch)
treed49eacfa5bce8732161c402b10b71f71389b929f /lib/compiler
parent91f6cbf123d4bf8ac4b7d0389fdb364667ada761 (diff)
parentc2157dc06a8c997c207dd82cd6fa11dbcb508f11 (diff)
downloadotp-2b34c1fb98053b3cff3cfb38f9e9c2c94405eb3f.tar.gz
otp-2b34c1fb98053b3cff3cfb38f9e9c2c94405eb3f.tar.bz2
otp-2b34c1fb98053b3cff3cfb38f9e9c2c94405eb3f.zip
Merge branch 'maint'
* maint: Fix spec of compile:(noenv_)forms/2
Diffstat (limited to 'lib/compiler')
-rw-r--r--lib/compiler/src/compile.erl8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/compiler/src/compile.erl b/lib/compiler/src/compile.erl
index e2eff2a89b..e951a25e04 100644
--- a/lib/compiler/src/compile.erl
+++ b/lib/compiler/src/compile.erl
@@ -43,6 +43,10 @@
-type abstract_code() :: [erl_parse:abstract_form()].
+%% Internal representations used for 'from_asm' and 'from_beam' compilation can
+%% also be valid, but have no relevant types defined.
+-type forms() :: abstract_code() | cerl:c_module().
+
-type option() :: atom() | {atom(), term()} | {'d', atom(), term()}.
-type err_info() :: {erl_anno:line() | 'none',
@@ -88,7 +92,7 @@ file(File, Opt) ->
forms(Forms) -> forms(Forms, ?DEFAULT_OPTIONS).
--spec forms(abstract_code(), [option()] | option()) -> comp_ret().
+-spec forms(forms(), [option()] | option()) -> comp_ret().
forms(Forms, Opts) when is_list(Opts) ->
do_compile({forms,Forms}, [binary|Opts++env_default_opts()]);
@@ -116,7 +120,7 @@ noenv_file(File, Opts) when is_list(Opts) ->
noenv_file(File, Opt) ->
noenv_file(File, [Opt|?DEFAULT_OPTIONS]).
--spec noenv_forms(abstract_code(), [option()] | option()) -> comp_ret().
+-spec noenv_forms(forms(), [option()] | option()) -> comp_ret().
noenv_forms(Forms, Opts) when is_list(Opts) ->
do_compile({forms,Forms}, [binary|Opts]);