From a1dbdf34d5845aa13d0c747c0cf3d0eb315b256a Mon Sep 17 00:00:00 2001 From: Folkert Date: Sat, 19 Mar 2022 23:41:56 +0100 Subject: [PATCH] simplify empty let constraint --- compiler/constrain/src/expr.rs | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/compiler/constrain/src/expr.rs b/compiler/constrain/src/expr.rs index 7af34a43f7..597859fd4f 100644 --- a/compiler/constrain/src/expr.rs +++ b/compiler/constrain/src/expr.rs @@ -1765,14 +1765,7 @@ pub fn rec_defs_help( NoExpectation(expr_type), ); - // TODO investigate if this let can be safely removed - let def_con = constraints.let_constraint( - [], - [], // empty because Roc function defs have no args - [], // empty because Roc function defs have no args - Constraint::True, // I think this is correct, once again because there are no args - expr_con, - ); + let def_con = expr_con; flex_info.vars = def_pattern_state.vars; flex_info.constraints.push(def_con); @@ -1983,13 +1976,7 @@ pub fn rec_defs_help( ); let cons = [ - constraints.let_constraint( - [], - [], - [], - Constraint::True, - ret_constraint, - ), + ret_constraint, // Store type into AST vars. We use Store so errors aren't reported twice constraints.store(signature, expr_var, std::file!(), std::line!()), ];