Polymorphism support #848

Merged
ghallak merged 53 commits from ghallak/307 into master 2022-06-17 18:09:07 +09:00
Showing only changes of commit 78d2ce2e75 - Show all commits

View File

@ -933,7 +933,8 @@ match_impls([{fun_decl, _, {id, _, FunName}, {fun_t, _, _, ArgsTypes, RetDecl}}
-spec compare_types(T, T) -> boolean() when T :: utype() | [utype()]. -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 length(Types1) == length(Types2) andalso
lists:all(fun({T1, T2}) -> compare_types(T1, T2) end, lists:zip(Types1, Types2)); lists:all(fun({T1, T2}) -> compare_types(T1, T2) end, lists:zip(Types1, Types2));
compare_types({fun_t, _, _, Types1, RetType1}, {fun_t, _, _, Types2, RetType2}) -> compare_types({fun_t, _, _, Types1, RetType1}, {fun_t, _, _, Types2, RetType2}) ->