From e64bdd40d27e32b1db45f59a34826aaf64a8d515 Mon Sep 17 00:00:00 2001 From: Gaith Hallak Date: Fri, 16 Dec 2022 13:20:43 +0300 Subject: [PATCH] Show empty map or record error when assigning to const --- 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 797c5f0..e320fc0 100644 --- a/src/aeso_ast_infer_types.erl +++ b/src/aeso_ast_infer_types.erl @@ -2093,7 +2093,7 @@ infer_expr(Env = #env{ current_const = none }, {block, Attrs, Stmts}) -> BlockType = fresh_uvar(Attrs), NewStmts = infer_block(Env, Attrs, Stmts, BlockType), {typed, Attrs, {block, Attrs, NewStmts}, BlockType}; -infer_expr(#env{ current_const = none }, {record_or_map_error, Attrs, Fields}) -> +infer_expr(_Env, {record_or_map_error, Attrs, Fields}) -> type_error({mixed_record_and_map, {record, Attrs, Fields}}), Type = fresh_uvar(Attrs), {typed, Attrs, {record, Attrs, []}, Type};