Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir_ty/src/infer/expr.rs')
| -rw-r--r-- | crates/hir_ty/src/infer/expr.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/crates/hir_ty/src/infer/expr.rs b/crates/hir_ty/src/infer/expr.rs index 13f64d6825..b08a9618d8 100644 --- a/crates/hir_ty/src/infer/expr.rs +++ b/crates/hir_ty/src/infer/expr.rs @@ -532,6 +532,11 @@ impl<'a> InferenceContext<'a> { .substitute(Interner, ¶meters), ) } else { + // Write down the first field resolution even if it is not visible + // This aids IDE features for private fields like goto def and in + // case of autoderef finding an applicable field, this will be + // overwritten in a following cycle + self.write_field_resolution_if_empty(tgt_expr, field); None } } @@ -546,6 +551,11 @@ impl<'a> InferenceContext<'a> { .substitute(Interner, ¶meters), ) } else { + // Write down the first field resolution even if it is not visible + // This aids IDE features for private fields like goto def and in + // case of autoderef finding an applicable field, this will be + // overwritten in a following cycle + self.write_field_resolution_if_empty(tgt_expr, field); None } } |