Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir/src/semantics/child_by_source.rs')
| -rw-r--r-- | crates/hir/src/semantics/child_by_source.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/crates/hir/src/semantics/child_by_source.rs b/crates/hir/src/semantics/child_by_source.rs index d5dfb98571..ef10a4e148 100644 --- a/crates/hir/src/semantics/child_by_source.rs +++ b/crates/hir/src/semantics/child_by_source.rs @@ -160,7 +160,11 @@ impl ChildBySource for VariantId { let arena_map = arena_map.as_ref(); let parent = *self; for (local_id, source) in arena_map.value.iter() { - let id = FieldId { parent, local_id }; + let has_default = match source { + Either::Left(_) => false, + Either::Right(rec) => rec.expr().is_some(), + }; + let id = FieldId { parent, local_id, has_default }; match source.clone() { Either::Left(source) => res[keys::TUPLE_FIELD].insert(AstPtr::new(&source), id), Either::Right(source) => res[keys::RECORD_FIELD].insert(AstPtr::new(&source), id), |