From 2ca91b2f861a17a741ef0249dd11a319dc72660b Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Sun, 4 Nov 2012 17:24:15 +0100 Subject: 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. --- lib/compiler/test/inline_SUITE.erl | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'lib/compiler/test') 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) -> -- cgit v1.2.3