@@ -237,16 +237,12 @@ fn maybe_var_eq_narrow(
237237 }
238238
239239 let right_expr_type = infer_expr ( db, cache, right_expr) ?;
240- let antecedent_flow_id = get_single_antecedent ( tree, flow_node) ?;
241- let antecedent_type =
242- get_type_at_flow ( db, tree, cache, root, & var_ref_id, antecedent_flow_id) ?;
243-
244240 let result_type = match condition_flow {
245- InferConditionFlow :: TrueCondition => {
246- narrow_down_type ( db, antecedent_type, right_expr_type. clone ( ) )
247- . unwrap_or ( right_expr_type)
248- }
241+ InferConditionFlow :: TrueCondition => right_expr_type,
249242 InferConditionFlow :: FalseCondition => {
243+ let antecedent_flow_id = get_single_antecedent ( tree, flow_node) ?;
244+ let antecedent_type =
245+ get_type_at_flow ( db, tree, cache, root, & var_ref_id, antecedent_flow_id) ?;
250246 TypeOps :: Remove . apply ( db, & antecedent_type, & right_expr_type)
251247 }
252248 } ;
@@ -293,16 +289,12 @@ fn maybe_var_eq_narrow(
293289 }
294290
295291 let right_expr_type = infer_expr ( db, cache, right_expr) ?;
296- let antecedent_flow_id = get_single_antecedent ( tree, flow_node) ?;
297- let antecedent_type =
298- get_type_at_flow ( db, tree, cache, root, & var_ref_id, antecedent_flow_id) ?;
299-
300292 let result_type = match condition_flow {
301- InferConditionFlow :: TrueCondition => {
302- narrow_down_type ( db, antecedent_type, right_expr_type. clone ( ) )
303- . unwrap_or ( right_expr_type)
304- }
293+ InferConditionFlow :: TrueCondition => right_expr_type,
305294 InferConditionFlow :: FalseCondition => {
295+ let antecedent_flow_id = get_single_antecedent ( tree, flow_node) ?;
296+ let antecedent_type =
297+ get_type_at_flow ( db, tree, cache, root, & var_ref_id, antecedent_flow_id) ?;
306298 TypeOps :: Remove . apply ( db, & antecedent_type, & right_expr_type)
307299 }
308300 } ;
0 commit comments