mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 02:39:28 +00:00
collect_structs: Also visit the type of array expression
Prevent compilation error in the generated code when dealing with empty array expression of a given type, which is otherwise optimized out Fixes #1733
This commit is contained in:
parent
9899a3bd43
commit
328cee7289
2 changed files with 15 additions and 4 deletions
|
@ -43,10 +43,10 @@ fn collect_structs_in_component(root_component: &Rc<Component>, hash: &mut BTree
|
|||
});
|
||||
|
||||
visit_all_expressions(root_component, |expr, _| {
|
||||
expr.visit_recursive(&mut |expr| {
|
||||
if let Expression::Struct { ty, .. } = expr {
|
||||
maybe_collect_object(ty)
|
||||
}
|
||||
expr.visit_recursive(&mut |expr| match expr {
|
||||
Expression::Struct { ty, .. } => maybe_collect_object(ty),
|
||||
Expression::Array { element_ty, .. } => maybe_collect_object(element_ty),
|
||||
_ => (),
|
||||
})
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue