From b26a472ccb32a520eb809505a7dc465f8050268f Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Tue, 25 May 2021 11:15:02 +0200 Subject: Fix type mismatch caused by macros MacroStmts should be completely transparent, but it prevented coercion. (I should maybe give `infer_expr` and `infer_expr_inner` better names.) --- crates/hir_ty/src/infer/expr.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/hir_ty/src/infer/expr.rs') diff --git a/crates/hir_ty/src/infer/expr.rs b/crates/hir_ty/src/infer/expr.rs index eab8fac91..79a732106 100644 --- a/crates/hir_ty/src/infer/expr.rs +++ b/crates/hir_ty/src/infer/expr.rs @@ -805,7 +805,7 @@ impl<'a> InferenceContext<'a> { None => self.table.new_float_var(), }, }, - Expr::MacroStmts { tail } => self.infer_expr(*tail, expected), + Expr::MacroStmts { tail } => self.infer_expr_inner(*tail, expected), }; // use a new type variable if we got unknown here let ty = self.insert_type_vars_shallow(ty); -- cgit v1.2.3