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.)
This commit is contained in:
Florian Diebold 2021-05-25 11:15:02 +02:00
parent 8b049ec393
commit b26a472ccb
2 changed files with 45 additions and 1 deletions

View file

@ -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);