diff --git a/src/aeso_ast_infer_types.erl b/src/aeso_ast_infer_types.erl index 154e617..76e8d62 100644 --- a/src/aeso_ast_infer_types.erl +++ b/src/aeso_ast_infer_types.erl @@ -168,7 +168,8 @@ global_env() -> {["Bits", "intersection"], Fun([Bits, Bits], Bits)}, {["Bits", "union"], Fun([Bits, Bits], Bits)}, {["Bits", "difference"], Fun([Bits, Bits], Bits)}, - {["Bits", "zero"], Bits}, + {["Bits", "none"], Bits}, + {["Bits", "all"], Bits}, %% Conversion {["Int", "to_str"], Fun1(Int, String)}, {["Address", "to_str"], Fun1(Address, String)} diff --git a/src/aeso_ast_to_icode.erl b/src/aeso_ast_to_icode.erl index b9fb28f..a3a55aa 100644 --- a/src/aeso_ast_to_icode.erl +++ b/src/aeso_ast_to_icode.erl @@ -368,8 +368,10 @@ ast_body(?qid_app(["Bits", Fun], Args, _, _), Icode) ["intersection", A, B] -> And(A, B); ["difference", A, B] -> And(A, Neg(And(A, B))) end; -ast_body({qid, _, ["Bits", "zero"]}, _Icode) -> +ast_body({qid, _, ["Bits", "none"]}, _Icode) -> #integer{ value = 0 }; +ast_body({qid, _, ["Bits", "all"]}, _Icode) -> + #integer{ value = -1 }; ast_body(?qid_app(["Bits", "sum"], [Bits], _, _), Icode) -> builtin_call(popcount, [ast_body(Bits, Icode), #integer{ value = 0 }]);