aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/test/inline_SUITE.erl
diff options
context:
space:
mode:
authorAnthony Ramine <[email protected]>2012-11-04 17:24:15 +0100
committerFredrik Gustafsson <[email protected]>2013-01-16 15:05:41 +0100
commit2ca91b2f861a17a741ef0249dd11a319dc72660b (patch)
tree7e648ecb3450f0637c70ae41a9b0edf3dab3929f /lib/compiler/test/inline_SUITE.erl
parent98ee8e929c7e4015fab483a7eb112a94e777ea3b (diff)
downloadotp-2ca91b2f861a17a741ef0249dd11a319dc72660b.tar.gz
otp-2ca91b2f861a17a741ef0249dd11a319dc72660b.tar.bz2
otp-2ca91b2f861a17a741ef0249dd11a319dc72660b.zip
Make inlined list functions fail with function_clause
The function_clause errors produced by inline_list_funcs should properly be annotated with their function names to avoid kernel_v3 making them into case_clauses errors. See v3_kernel:translate_match_fail_1/4.
Diffstat (limited to 'lib/compiler/test/inline_SUITE.erl')
-rw-r--r--lib/compiler/test/inline_SUITE.erl22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/compiler/test/inline_SUITE.erl b/lib/compiler/test/inline_SUITE.erl
index 2e17d3fde6..01bc9b34ad 100644
--- a/lib/compiler/test/inline_SUITE.erl
+++ b/lib/compiler/test/inline_SUITE.erl
@@ -255,6 +255,28 @@ lists(Config) when is_list(Config) ->
%% Cleanup.
erase(?MODULE),
+
+ {'EXIT',{function_clause,_}} =
+ (catch lists:map(fun (X) -> X end, not_a_list)),
+ {'EXIT',{function_clause,_}} =
+ (catch lists:flatmap(fun (X) -> X end, not_a_list)),
+ {'EXIT',{function_clause,_}} =
+ (catch lists:foreach(fun (X) -> X end, not_a_list)),
+ {'EXIT',{function_clause,_}} =
+ (catch lists:filter(fun (_) -> true end, not_a_list)),
+ {'EXIT',{function_clause,_}} =
+ (catch lists:any(fun (_) -> false end, not_a_list)),
+ {'EXIT',{function_clause,_}} =
+ (catch lists:all(fun (_) -> true end, not_a_list)),
+ {'EXIT',{function_clause,_}} =
+ (catch lists:foldl(fun (X, Acc) -> {X,Acc} end, acc, not_a_list)),
+ {'EXIT',{function_clause,_}} =
+ (catch lists:foldr(fun (X, Acc) -> {X,Acc} end, acc, not_a_list)),
+ {'EXIT',{function_clause,_}} =
+ (catch lists:mapfoldl(fun (X, Acc) -> {X,Acc} end, acc, not_a_list)),
+ {'EXIT',{function_clause,_}} =
+ (catch lists:mapfoldr(fun (X, Acc) -> {X,Acc} end, acc, not_a_list)),
+
ok.
my_apply(M, F, A, Init) ->