| 1 | // Copyright © SixtyFPS GmbH <info@slint.dev> |
| 2 | // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0 |
| 3 | |
| 4 | |
| 5 | WithStates := Rectangle { |
| 6 | property <brush> extra_background; |
| 7 | property <bool> condition; |
| 8 | background: yellow; |
| 9 | // ^error{The binding for the property 'background' is part of a binding loop} //FIXME: ideally we'd keep the span within the state |
| 10 | states [ |
| 11 | xxx when condition : { |
| 12 | background: extra_background; |
| 13 | } |
| 14 | ] |
| 15 | } |
| 16 | |
| 17 | export Test := Rectangle { |
| 18 | |
| 19 | property <int> a: 45 + root.b; |
| 20 | // ^error{The binding for the property 'a' is part of a binding loop} |
| 21 | property <float> b: root.c; |
| 22 | // ^error{The binding for the property 'b' is part of a binding loop} |
| 23 | property <int> c <=> d; |
| 24 | // ^error{The binding for the property 'c' is part of a binding loop} |
| 25 | property <int> d: root.a + root.e; |
| 26 | // ^error{The binding for the property 'd' is part of a binding loop} |
| 27 | property <int> e: root.b; |
| 28 | // ^error{The binding for the property 'e' is part of a binding loop} |
| 29 | property <int> w: root.a + root.b; // This id not part of a loop |
| 30 | |
| 31 | property<bool> cond: xx.x == 0; |
| 32 | // ^error{The binding for the property 'cond' is part of a binding loop} |
| 33 | |
| 34 | xx := Rectangle { |
| 35 | x: y; |
| 36 | // ^error{The binding for the property 'x' is part of a binding loop} |
| 37 | y: root.cond ? 42px : 55px; |
| 38 | // ^error{The binding for the property 'y' is part of a binding loop} |
| 39 | } |
| 40 | |
| 41 | WithStates { |
| 42 | extra_background: background; |
| 43 | // ^error{The binding for the property 'extra-background' is part of a binding loop} |
| 44 | } |
| 45 | } |
| 46 | |