From 78d2ce2e75694169a5550e1a113413f60834e29e Mon Sep 17 00:00:00 2001 From: Gaith Hallak Date: Wed, 20 Apr 2022 19:34:38 +0400 Subject: [PATCH] Use is_list to check if a var is a list --- src/aeso_ast_infer_types.erl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/aeso_ast_infer_types.erl b/src/aeso_ast_infer_types.erl index 32b848c..875cf7e 100644 --- a/src/aeso_ast_infer_types.erl +++ b/src/aeso_ast_infer_types.erl @@ -933,7 +933,8 @@ match_impls([{fun_decl, _, {id, _, FunName}, {fun_t, _, _, ArgsTypes, RetDecl}} -spec compare_types(T, T) -> boolean() when T :: utype() | [utype()]. -compare_types(Types1 = [_ | _], Types2 = [_ | _]) -> +compare_types(Types1, Types2) + when is_list(Types1) andalso is_list(Types2) -> length(Types1) == length(Types2) andalso lists:all(fun({T1, T2}) -> compare_types(T1, T2) end, lists:zip(Types1, Types2)); compare_types({fun_t, _, _, Types1, RetType1}, {fun_t, _, _, Types2, RetType2}) ->