[ty] fix hover type on named expression target (#21952)

## Summary

What it says on the tin.

## Test Plan

Added hover test.
This commit is contained in:
Carl Meyer
2025-12-12 09:30:50 -08:00
committed by GitHub
parent 90b29c9e87
commit 69d1bfbebc
2 changed files with 34 additions and 3 deletions

View File

@@ -8164,10 +8164,10 @@ impl<'db, 'ast> TypeInferenceBuilder<'db, 'ast> {
value,
} = named;
self.infer_expression(target, TypeContext::default());
self.add_binding(named.target.as_ref().into(), definition, |builder, tcx| {
builder.infer_expression(value, tcx)
let ty = builder.infer_expression(value, tcx);
builder.store_expression_type(target, ty);
ty
})
}