mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 06:44:46 +00:00
Do not show record type signature if it contains at least one private tag
This commit is contained in:
parent
6050776ff8
commit
09aad833d5
1 changed files with 7 additions and 8 deletions
|
@ -242,23 +242,22 @@ fn type_to_docs(type_annotation: ast::TypeAnnotation) -> Option<TypeAnnotation>
|
|||
|
||||
let mut any_fields_include_private_tags = false;
|
||||
|
||||
let mut index = 0;
|
||||
|
||||
while index < fields.len() && !any_fields_include_private_tags {
|
||||
let field = fields[index];
|
||||
|
||||
for field in fields {
|
||||
match record_field_to_doc(field.value) {
|
||||
None => {
|
||||
any_fields_include_private_tags = true;
|
||||
break;
|
||||
}
|
||||
Some(doc_field) => {
|
||||
doc_fields.push(doc_field);
|
||||
|
||||
index = index + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
Some(Record { fields: doc_fields })
|
||||
if any_fields_include_private_tags {
|
||||
None
|
||||
} else {
|
||||
Some(Record { fields: doc_fields })
|
||||
}
|
||||
}
|
||||
ast::TypeAnnotation::SpaceBefore(&sub_type_ann, _) => type_to_docs(sub_type_ann),
|
||||
ast::TypeAnnotation::SpaceAfter(&sub_type_ann, _) => type_to_docs(sub_type_ann),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue