mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-29 05:14:48 +00:00

That way the error for an expression is at a better location, and this also prevent the formater that removes space in expressions to remove the spaces before the expression that shouldn't be removed
44 lines
1.4 KiB
Text
44 lines
1.4 KiB
Text
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
|
|
|
global G := {
|
|
property <int> alala <=> alala;
|
|
// ^error{Property cannot alias to itself}
|
|
property <string> yoyo <=> alala;
|
|
// ^error{The property does not have the same type as the bound property}
|
|
}
|
|
|
|
export X := Rectangle {
|
|
|
|
property <brush> my_color <=> self.background;
|
|
x <=> y;
|
|
width <=> self.height;
|
|
|
|
|
|
border_color <=> blue;
|
|
// ^error{The expression in a two way binding must be a property reference}
|
|
border_width <=> 4px + 4px;
|
|
// ^error{The expression in a two way binding must be a property reference}
|
|
|
|
xx := Rectangle {
|
|
x: 42phx;
|
|
width <=> parent.width;
|
|
height <=> x;
|
|
background <=> root.x;
|
|
// ^error{The property does not have the same type as the bound property}
|
|
y <=> y;
|
|
// ^error{Property cannot alias to itself}
|
|
}
|
|
|
|
property <int> dd <=> dd;
|
|
// ^error{Property cannot alias to itself}
|
|
|
|
Rectangle {
|
|
x <=> self.loop_on_x;
|
|
// ^error{The binding for the property 'x' is part of a binding loop}
|
|
property <length> loop_on_x <=> x;
|
|
// ^error{The binding for the property 'loop-on-x' is part of a binding loop}
|
|
}
|
|
|
|
property gyoyo <=> G.yoyo;
|
|
}
|