From e9a210cb8d308b99b822adda093da23cb6b9ad51 Mon Sep 17 00:00:00 2001 From: Gaith Hallak Date: Tue, 10 Aug 2021 15:23:31 +0300 Subject: [PATCH] Use check_expr instead of hard-coded type --- 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 4d7ec9d..1e6baf8 100644 --- a/src/aeso_ast_infer_types.erl +++ b/src/aeso_ast_infer_types.erl @@ -1705,7 +1705,7 @@ infer_expr(Env, {lam, Attrs, Args, Body}) -> {typed, Attrs, {lam, Attrs, NewArgs, NewBody}, {fun_t, Attrs, [], ArgTypes, ResultType}}; infer_expr(Env, {letpat, Attrs, Id, Pattern}) -> NewPattern = {typed, _, _, PatType} = infer_expr(Env, Pattern), - {typed, Attrs, {letpat, Attrs, {typed, Attrs, Id, PatType}, NewPattern}, PatType}; + {typed, Attrs, {letpat, Attrs, check_expr(Env, Id, PatType), NewPattern}, PatType}; infer_expr(Env, Let = {letval, Attrs, _, _}) -> type_error({missing_body_for_let, Attrs}), infer_expr(Env, {block, Attrs, [Let, abort_expr(Attrs, "missing body")]});