From aa8ae76aca3daa5544762464f54f9a789387657c Mon Sep 17 00:00:00 2001 From: Gaith Hallak Date: Fri, 16 Dec 2022 13:11:06 +0300 Subject: [PATCH] Revert "Do not reverse constants declarations" This reverts commit c4647fadacd134866e4be9c2ab4b0d54870a35fd. --- src/aeso_ast_infer_types.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/aeso_ast_infer_types.erl b/src/aeso_ast_infer_types.erl index 5b18ca0..797c5f0 100644 --- a/src/aeso_ast_infer_types.erl +++ b/src/aeso_ast_infer_types.erl @@ -270,7 +270,7 @@ bind_const(X, Ann, Type, Env) -> -spec bind_consts(env(), #{ name() => aeso_syntax:decl() }, [{acyclic, name()} | {cyclic, [name()]}], [aeso_syntax:decl()]) -> {env(), [aeso_syntax:decl()]}. bind_consts(Env, _Consts, [], Acc) -> - {Env, Acc}; + {Env, lists:reverse(Acc)}; bind_consts(Env, Consts, [{cyclic, Xs} | _SCCs], _Acc) -> ConstDecls = [ maps:get(X, Consts) || X <- Xs ], type_error({mutually_recursive_constants, lists:reverse(ConstDecls)}),