You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
3
+
4
+
// A component whose cross-axis `layoutinfo-v` binding transitively reads its
5
+
// own width (here, through a word-wrapping `Text` inside an inner layout)
6
+
// forms a cycle when placed inside a FlexboxLayout: `SolveFlexboxLayout` needs
7
+
// the child's `layoutinfo-v`, but the child's compiled `layoutinfo-v` binding
8
+
// reads widths that depend back on `SolveFlexboxLayout`. Builtins avoid this
9
+
// because they receive the cross-axis constraint through the item VTable
10
+
// (`cross_axis_constraint`), but components don't have that shortcut — so the
11
+
// dependency must be reported by the binding-loop pass.
12
+
13
+
componentInner {
14
+
// >error{The binding for the property 'layoutinfo-v' is part of a binding loop (layoutinfo-v -> layout-cache -> width -> width -> layout-cache -> width -> layoutinfo-v -> layoutinfo-v)}
15
+
HorizontalLayout {
16
+
// > <error{The binding for the property 'width' is part of a binding loop (layoutinfo-v -> layout-cache -> width -> width -> layout-cache -> width -> layoutinfo-v -> layoutinfo-v)}
17
+
// > <^error{The binding for the property 'layout-cache' is part of a binding loop (layoutinfo-v -> layout-cache -> width -> width -> layout-cache -> width -> layoutinfo-v -> layoutinfo-v)}
18
+
// > <^^error{The binding for the property 'width' is part of a binding loop (layoutinfo-v -> layout-cache -> width -> width -> layout-cache -> width -> layoutinfo-v -> layoutinfo-v)}
19
+
// > <^^^error{The binding for the property 'layoutinfo-v' is part of a binding loop (layoutinfo-v -> layout-cache -> width -> width -> layout-cache -> width -> layoutinfo-v -> layoutinfo-v)}
20
+
Text { text: "hello"; wrap: word-wrap; }
21
+
}
22
+
}
23
+
//<<<error{The binding for the property 'layoutinfo-v' is part of a binding loop (layoutinfo-v -> layout-cache -> width -> width -> layout-cache -> width -> layoutinfo-v -> layoutinfo-v)}
24
+
25
+
exportcomponentDemoinheritsWindow {
26
+
FlexboxLayout {
27
+
// > <error{The binding for the property 'layout-cache' is part of a binding loop (layoutinfo-v -> layout-cache -> width -> width -> layout-cache -> width -> layoutinfo-v -> layoutinfo-v)}
28
+
// > <^error{The binding for the property 'width' is part of a binding loop (layoutinfo-v -> layout-cache -> width -> width -> layout-cache -> width -> layoutinfo-v -> layoutinfo-v)}
0 commit comments