From 048c2ca98d62dbc3cfa914859ffc80a4e89d8958 Mon Sep 17 00:00:00 2001 From: Ulf Norell Date: Mon, 23 Sep 2019 11:40:15 +0200 Subject: [PATCH] Fix bug with missing fields causing compiler crash ... if under a lambda or switch. --- 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 8a59964..0aa09db 100644 --- a/src/aeso_ast_infer_types.erl +++ b/src/aeso_ast_infer_types.erl @@ -1332,7 +1332,7 @@ infer_case(Env, Attrs, Pattern, ExprType, Branch, SwitchType) -> end, NewEnv = bind_vars([{Var, fresh_uvar(Ann)} || Var = {id, Ann, _} <- Vars], Env#env{ in_pattern = true }), NewPattern = {typed, _, _, PatType} = infer_expr(NewEnv, Pattern), - NewBranch = check_expr(NewEnv, Branch, SwitchType), + NewBranch = check_expr(NewEnv#env{ in_pattern = false }, Branch, SwitchType), unify(Env, PatType, ExprType, {case_pat, Pattern, PatType, ExprType}), {'case', Attrs, NewPattern, NewBranch}.