mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 10:50:00 +00:00
parent
4fa983522e
commit
f73c1cf80d
2 changed files with 21 additions and 9 deletions
|
@ -1059,8 +1059,8 @@ impl Expression {
|
|||
op: '*',
|
||||
},
|
||||
(
|
||||
Type::Struct { fields: ref left, .. },
|
||||
Type::Struct { fields: right, name, node: n, rust_attributes },
|
||||
ref from_ty @ Type::Struct { fields: ref left, .. },
|
||||
Type::Struct { fields: right, .. },
|
||||
) if left != right => {
|
||||
if let Expression::Struct { mut values, .. } = self {
|
||||
let mut new_values = HashMap::new();
|
||||
|
@ -1080,12 +1080,7 @@ impl Expression {
|
|||
Expression::StructFieldAccess {
|
||||
base: Box::new(Expression::ReadLocalVariable {
|
||||
name: var_name.into(),
|
||||
ty: Type::Struct {
|
||||
fields: left.clone(),
|
||||
name: name.clone(),
|
||||
node: n.clone(),
|
||||
rust_attributes: rust_attributes.clone(),
|
||||
},
|
||||
ty: from_ty.clone(),
|
||||
}),
|
||||
name: key.clone(),
|
||||
}
|
||||
|
|
|
@ -7,9 +7,14 @@ struct Foo1 { member: int, }
|
|||
struct Foo2 { a: Foo1 }
|
||||
struct Foo3 { b: int }
|
||||
|
||||
|
||||
struct DeleteMe { c: color }
|
||||
|
||||
struct Palette {
|
||||
menuBar : brush,
|
||||
mainContent : brush,
|
||||
box : brush,
|
||||
}
|
||||
|
||||
export component TestCase inherits Rectangle {
|
||||
pure callback cb1(Foo2) -> Foo3;
|
||||
cb1(foo) => { return { b: foo.a.member+1 }; }
|
||||
|
@ -24,6 +29,18 @@ export component TestCase inherits Rectangle {
|
|||
property<[DeleteMe]> data;
|
||||
for d[i] in self.data: Rectangle { }
|
||||
}
|
||||
|
||||
// Bug #2765
|
||||
out property<Palette> palette : xx.a.member > 32 ? {
|
||||
menuBar : #6D7BFB,
|
||||
mainContent : #fbfbfb,
|
||||
box : #ffffff,
|
||||
} : {
|
||||
menuBar : #2937A7,
|
||||
mainContent : #040404,
|
||||
box : #000000,
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue