Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/infer.rs')
-rw-r--r--crates/hir-ty/src/infer.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/crates/hir-ty/src/infer.rs b/crates/hir-ty/src/infer.rs
index 8c70461ff6..d103bacb8f 100644
--- a/crates/hir-ty/src/infer.rs
+++ b/crates/hir-ty/src/infer.rs
@@ -2011,9 +2011,10 @@ impl<'body, 'db> InferenceContext<'body, 'db> {
&& let GeneralConstId::AnonConstId(konst) = konst.def.0
{
self.defined_anon_consts.borrow_mut().push(konst);
+ } else {
+ self.write_expr_ty(expr, expected_ty);
}
- self.write_expr_ty(expr, expected_ty);
// FIXME: Report an error if needed.
konst.unwrap_or_else(|_| self.table.next_const_var(Span::Dummy))
}