From 933e5806182cae377fb65e6155689425c8ecc7d1 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 10 Jan 2022 14:21:29 +0100 Subject: [PATCH] LLR: Fix some issues with globals --- sixtyfps_compiler/llr/lower_to_item_tree.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sixtyfps_compiler/llr/lower_to_item_tree.rs b/sixtyfps_compiler/llr/lower_to_item_tree.rs index 0dae168c4..3239a7e2b 100644 --- a/sixtyfps_compiler/llr/lower_to_item_tree.rs +++ b/sixtyfps_compiler/llr/lower_to_item_tree.rs @@ -421,7 +421,9 @@ fn lower_global( ); properties.push(Property { name: p.clone(), ty: x.property_type.clone() }); - const_properties.push(nr.is_constant()); + if !matches!(x.property_type, Type::Callback { .. }) { + const_properties.push(nr.is_constant()); + } state .global_properties .insert(nr.clone(), PropertyReference::Global { global_index, property_index }); @@ -464,7 +466,7 @@ fn lower_global( let public_properties = public_properties(global, &mapping, &state); GlobalComponent { - name: global.id.clone(), + name: global.root_element.borrow().id.clone(), properties, init_values, const_properties,