Rename check_implemented_interfaces_recursive to check_implemented_interfaces1
This commit is contained in:
parent
3fc6d47223
commit
5624279d6d
@ -888,27 +888,27 @@ check_implemented_interfaces(Env, {_Contract, _Ann, ConName, Impls, Code}, What,
|
|||||||
ImplementedInterfaces = [I || I <- [proplists:get_value(Name, AllInterfaces) || Name <- ImplsNames],
|
ImplementedInterfaces = [I || I <- [proplists:get_value(Name, AllInterfaces) || Name <- ImplsNames],
|
||||||
I /= undefined],
|
I /= undefined],
|
||||||
Letfuns = [ Fun || Fun = {letfun, _, _, _, _, _} <- Code ],
|
Letfuns = [ Fun || Fun = {letfun, _, _, _, _, _} <- Code ],
|
||||||
check_implemented_interfaces_recursive(ImplementedInterfaces, ConName, Letfuns, AllInterfaces);
|
check_implemented_interfaces1(ImplementedInterfaces, ConName, Letfuns, AllInterfaces);
|
||||||
contract_interface ->
|
contract_interface ->
|
||||||
ok
|
ok
|
||||||
end,
|
end,
|
||||||
destroy_and_report_type_errors(Env).
|
destroy_and_report_type_errors(Env).
|
||||||
|
|
||||||
check_implemented_interfaces_recursive(ImplementedInterfaces, ConId, Letfuns, AllInterfaces) ->
|
check_implemented_interfaces1(ImplementedInterfaces, ConId, Letfuns, AllInterfaces) ->
|
||||||
check_implemented_interfaces_recursive(ImplementedInterfaces, ConId, Letfuns, [], AllInterfaces).
|
check_implemented_interfaces1(ImplementedInterfaces, ConId, Letfuns, [], AllInterfaces).
|
||||||
|
|
||||||
%% Recursively check that all directly and indirectly referenced interfaces are implemented
|
%% Recursively check that all directly and indirectly referenced interfaces are implemented
|
||||||
check_implemented_interfaces_recursive([], _, _, _, _) ->
|
check_implemented_interfaces1([], _, _, _, _) ->
|
||||||
ok;
|
ok;
|
||||||
check_implemented_interfaces_recursive([{contract_interface, _, IName, Extensions, Decls} | Interfaces],
|
check_implemented_interfaces1([{contract_interface, _, IName, Extensions, Decls} | Interfaces],
|
||||||
ConId, Impls, Acc, AllInterfaces) ->
|
ConId, Impls, Acc, AllInterfaces) ->
|
||||||
case lists:member(name(IName), Acc) of
|
case lists:member(name(IName), Acc) of
|
||||||
true ->
|
true ->
|
||||||
check_implemented_interfaces_recursive(Interfaces, ConId, Impls, Acc, AllInterfaces);
|
check_implemented_interfaces1(Interfaces, ConId, Impls, Acc, AllInterfaces);
|
||||||
false ->
|
false ->
|
||||||
Unmatched = match_impls(Decls, ConId, name(IName), Impls),
|
Unmatched = match_impls(Decls, ConId, name(IName), Impls),
|
||||||
NewInterfaces = Interfaces ++ [proplists:get_value(name(I), AllInterfaces) || I <- Extensions],
|
NewInterfaces = Interfaces ++ [proplists:get_value(name(I), AllInterfaces) || I <- Extensions],
|
||||||
check_implemented_interfaces_recursive(NewInterfaces, ConId, Unmatched, [name(IName) | Acc], AllInterfaces)
|
check_implemented_interfaces1(NewInterfaces, ConId, Unmatched, [name(IName) | Acc], AllInterfaces)
|
||||||
end.
|
end.
|
||||||
|
|
||||||
%% Match the functions of the contract with the interfaces functions, and return unmatched functions
|
%% Match the functions of the contract with the interfaces functions, and return unmatched functions
|
||||||
|
Loading…
x
Reference in New Issue
Block a user