aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/test
diff options
context:
space:
mode:
authorAnthony Ramine <[email protected]>2012-11-04 19:20:29 +0100
committerFredrik Gustafsson <[email protected]>2013-01-16 15:05:41 +0100
commit572d66b1e4a5d5e519f89881a18bdf4f2745f62c (patch)
tree57d58f64f0983bc7d68f6899652476e27981660f /lib/compiler/test
parent2ca91b2f861a17a741ef0249dd11a319dc72660b (diff)
downloadotp-572d66b1e4a5d5e519f89881a18bdf4f2745f62c.tar.gz
otp-572d66b1e4a5d5e519f89881a18bdf4f2745f62c.tar.bz2
otp-572d66b1e4a5d5e519f89881a18bdf4f2745f62c.zip
Properly guard against badly-typed arguments when inlining
The inlining code for inline_list_funcs silenced the function_clause error that should occur when calling lists:map(3.5, []).
Diffstat (limited to 'lib/compiler/test')
-rw-r--r--lib/compiler/test/inline_SUITE.erl13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/compiler/test/inline_SUITE.erl b/lib/compiler/test/inline_SUITE.erl
index 01bc9b34ad..63180c3f95 100644
--- a/lib/compiler/test/inline_SUITE.erl
+++ b/lib/compiler/test/inline_SUITE.erl
@@ -277,6 +277,19 @@ lists(Config) when is_list(Config) ->
{'EXIT',{function_clause,_}} =
(catch lists:mapfoldr(fun (X, Acc) -> {X,Acc} end, acc, not_a_list)),
+ {'EXIT',{function_clause,_}} = (catch lists:map(not_a_function, [])),
+ {'EXIT',{function_clause,_}} = (catch lists:flatmap(not_a_function, [])),
+ {'EXIT',{function_clause,_}} = (catch lists:foreach(not_a_function, [])),
+ {'EXIT',{function_clause,_}} = (catch lists:filter(not_a_function, [])),
+ {'EXIT',{function_clause,_}} = (catch lists:any(not_a_function, [])),
+ {'EXIT',{function_clause,_}} = (catch lists:all(not_a_function, [])),
+ {'EXIT',{function_clause,_}} = (catch lists:foldl(not_a_function, acc, [])),
+ {'EXIT',{function_clause,_}} = (catch lists:foldr(not_a_function, acc, [])),
+ {'EXIT',{function_clause,_}} =
+ (catch lists:mapfoldl(not_a_function, acc, [])),
+ {'EXIT',{function_clause,_}} =
+ (catch lists:mapfoldr(not_a_function, acc, [])),
+
ok.
my_apply(M, F, A, Init) ->