aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src/cerl.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2018-04-04 14:10:21 +0200
committerGitHub <[email protected]>2018-04-04 14:10:21 +0200
commitdb1447e1423aaaafa02d52ca0b57115631990780 (patch)
treeafa43c1de02f6156535ce991470db9af648bc4d5 /lib/compiler/src/cerl.erl
parentf99860259ee557851acc865519a315f04d1d4d51 (diff)
parent63e1c58d27ab695a19897423fc75e607f69ff51b (diff)
downloadotp-db1447e1423aaaafa02d52ca0b57115631990780.tar.gz
otp-db1447e1423aaaafa02d52ca0b57115631990780.tar.bz2
otp-db1447e1423aaaafa02d52ca0b57115631990780.zip
Merge pull request #1725 from michalmuskala/fun-literals
Compile external fun expressions to literals OTP-15003
Diffstat (limited to 'lib/compiler/src/cerl.erl')
-rw-r--r--lib/compiler/src/cerl.erl2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/compiler/src/cerl.erl b/lib/compiler/src/cerl.erl
index 6b936a7687..fce23bfd68 100644
--- a/lib/compiler/src/cerl.erl
+++ b/lib/compiler/src/cerl.erl
@@ -433,6 +433,8 @@ is_literal_term(T) when is_tuple(T) ->
is_literal_term(B) when is_bitstring(B) -> true;
is_literal_term(M) when is_map(M) ->
is_literal_term_list(maps:to_list(M));
+is_literal_term(F) when is_function(F) ->
+ erlang:fun_info(F, type) =:= {type,external};
is_literal_term(_) ->
false.