Skip to content

Commit f81fef5

Browse files
committed
fix(thir_gen): remove unneeded branch in check
1 parent 2294827 commit f81fef5

1 file changed

Lines changed: 2 additions & 14 deletions

File tree

src/passes/thir_gen/mod.rs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -285,20 +285,8 @@ impl<'hir, 'ty> InferenceCtx<'hir, 'ty> {
285285
///
286286
/// This is used to propagate a type inwards.
287287
fn check(&mut self, expression_id: ExpressionId, expected: SolutionId) {
288-
let expression = &self.hir[expression_id];
289-
290-
match &expression.kind {
291-
ExpressionKind::Call(call) => {
292-
// Infer the call using the expected return type.
293-
self.infer_call(call, expected);
294-
let expression_ty = self.get_solution(expression_id);
295-
self.table.unify(self.types, expression_ty, expected);
296-
}
297-
_ => {
298-
let inferred = self.infer(expression_id);
299-
self.table.unify(self.types, inferred, expected);
300-
}
301-
}
288+
let inferred = self.infer(expression_id);
289+
self.table.unify(self.types, inferred, expected);
302290
}
303291

304292
/// Infer the type of an expression.

0 commit comments

Comments
 (0)