From 572d66b1e4a5d5e519f89881a18bdf4f2745f62c Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Sun, 4 Nov 2012 19:20:29 +0100 Subject: 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, []). --- lib/compiler/test/inline_SUITE.erl | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lib/compiler/test') 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) -> -- cgit v1.2.3