mirror of
https://github.com/slint-ui/slint.git
synced 2025-12-04 00:55:21 +00:00
compiler: Ignore leading whitespace when parsing
... and update all out test cases accordingly.
This commit is contained in:
parent
1fbbdf83b2
commit
bbdd6aeab7
49 changed files with 187 additions and 185 deletions
|
|
@ -606,6 +606,9 @@ impl Parser for DefaultParser<'_> {
|
|||
checkpoint: Option<Self::Checkpoint>,
|
||||
_: NodeToken,
|
||||
) {
|
||||
if kind != SyntaxKind::Document {
|
||||
self.consume_ws();
|
||||
}
|
||||
match checkpoint {
|
||||
None => self.builder.start_node(kind.into()),
|
||||
Some(cp) => self.builder.start_node_at(cp, kind.into()),
|
||||
|
|
|
|||
|
|
@ -4,12 +4,12 @@
|
|||
Button1 := Rectangle {
|
||||
property <bool> cond;
|
||||
accessible-role: cond ? button : AccessibleRole.text;
|
||||
// ^error{The `accessible-role` property must be a constant expression}
|
||||
// ^error{The `accessible-role` property must be a constant expression}
|
||||
}
|
||||
|
||||
Button2 := Rectangle {
|
||||
accessible-label: "the button";
|
||||
// ^error{The `accessible-label` property can only be set in combination to `accessible-role`}
|
||||
// ^error{The `accessible-label` property can only be set in combination to `accessible-role`}
|
||||
}
|
||||
|
||||
Button3 := Rectangle {
|
||||
|
|
@ -27,5 +27,5 @@ export Test := Window {
|
|||
Button2 { }
|
||||
Button3 {}
|
||||
Button3 { accessible-description: "error";}
|
||||
// ^error{The `accessible-description` property can only be set in combination to `accessible-role`}
|
||||
// ^error{The `accessible-description` property can only be set in combination to `accessible-role`}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ WithStates := Rectangle {
|
|||
property <brush> extra_background;
|
||||
property <bool> condition;
|
||||
background: yellow;
|
||||
// ^error{The binding for the property 'background' is part of a binding loop} //FIXME: ideally we'd keep the span within the state
|
||||
// ^error{The binding for the property 'background' is part of a binding loop} //FIXME: ideally we'd keep the span within the state
|
||||
states [
|
||||
xxx when condition : {
|
||||
background: extra_background;
|
||||
|
|
@ -17,29 +17,29 @@ WithStates := Rectangle {
|
|||
export Test := Rectangle {
|
||||
|
||||
property <int> a: 45 + root.b;
|
||||
// ^error{The binding for the property 'a' is part of a binding loop}
|
||||
// ^error{The binding for the property 'a' is part of a binding loop}
|
||||
property <float> b: root.c;
|
||||
// ^error{The binding for the property 'b' is part of a binding loop}
|
||||
// ^error{The binding for the property 'b' is part of a binding loop}
|
||||
property <int> c <=> d;
|
||||
// ^error{The binding for the property 'c' is part of a binding loop}
|
||||
property <int> d: root.a + root.e;
|
||||
// ^error{The binding for the property 'd' is part of a binding loop}
|
||||
// ^error{The binding for the property 'd' is part of a binding loop}
|
||||
property <int> e: root.b;
|
||||
// ^error{The binding for the property 'e' is part of a binding loop}
|
||||
// ^error{The binding for the property 'e' is part of a binding loop}
|
||||
property <int> w: root.a + root.b; // This id not part of a loopµ
|
||||
|
||||
property<bool> cond: xx.x == 0;
|
||||
// ^error{The binding for the property 'cond' is part of a binding loop}
|
||||
// ^error{The binding for the property 'cond' is part of a binding loop}
|
||||
|
||||
xx := Rectangle {
|
||||
x: y;
|
||||
// ^error{The binding for the property 'x' is part of a binding loop}
|
||||
// ^error{The binding for the property 'x' is part of a binding loop}
|
||||
y: root.cond ? 42px : 55px;
|
||||
// ^error{The binding for the property 'y' is part of a binding loop}
|
||||
// ^error{The binding for the property 'y' is part of a binding loop}
|
||||
}
|
||||
|
||||
WithStates {
|
||||
extra_background: background;
|
||||
// ^error{The binding for the property 'extra-background' is part of a binding loop}
|
||||
// ^error{The binding for the property 'extra-background' is part of a binding loop}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,15 +5,15 @@
|
|||
T1 := Rectangle {
|
||||
property <int> foo;
|
||||
property <int> bar: foo;
|
||||
// ^error{The binding for the property 'bar' is part of a binding loop}
|
||||
// ^error{The binding for the property 'bar' is part of a binding loop}
|
||||
Text { text: bar; }
|
||||
}
|
||||
|
||||
T2 := Rectangle {
|
||||
property <string> t2_text;
|
||||
t:= Text { text: t2_text; }
|
||||
// ^error{The binding for the property 'text' is part of a binding loop}
|
||||
// ^^error{The binding for the property 'text' is part of a binding loop}
|
||||
// ^error{The binding for the property 'text' is part of a binding loop}
|
||||
// ^^error{The binding for the property 'text' is part of a binding loop}
|
||||
property t_alias <=> t.text;
|
||||
// ^error{The binding for the property 't-alias' is part of a binding loop}
|
||||
// ^^error{The binding for the property 't-alias' is part of a binding loop}
|
||||
|
|
@ -25,9 +25,9 @@ T3 := Rectangle {
|
|||
// ^error{The binding for the property 'al' is part of a binding loop}
|
||||
HorizontalLayout {
|
||||
a := T2 { t2_text: b.t_alias; }
|
||||
// ^error{The binding for the property 't2-text' is part of a binding loop}
|
||||
// ^error{The binding for the property 't2-text' is part of a binding loop}
|
||||
b := T2 { t2_text: root.hello; }
|
||||
// ^error{The binding for the property 't2-text' is part of a binding loop}
|
||||
// ^error{The binding for the property 't2-text' is part of a binding loop}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -41,11 +41,11 @@ export App := Rectangle {
|
|||
VerticalLayout {
|
||||
T1 { foo: 44; }
|
||||
T1 { foo: bar; }
|
||||
// ^error{The binding for the property 'foo' is part of a binding loop}
|
||||
// ^error{The binding for the property 'foo' is part of a binding loop}
|
||||
T3 { hello: al; }
|
||||
// ^error{The binding for the property 'hello' is part of a binding loop}
|
||||
// ^error{The binding for the property 'hello' is part of a binding loop}
|
||||
|
||||
T4 { my_property: my_property; }
|
||||
// ^error{Property 'my-property' cannot refer to itself}
|
||||
// ^error{Property 'my-property' cannot refer to itself}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
Compo1 := Rectangle {
|
||||
|
||||
property <int> a : aa();
|
||||
// ^error{The binding for the property 'a' is part of a binding loop}
|
||||
// ^error{The binding for the property 'a' is part of a binding loop}
|
||||
pure callback aa() -> int;
|
||||
|
||||
function factorial(n: int) -> int {
|
||||
|
|
@ -24,7 +24,7 @@ export App := Rectangle {
|
|||
// ^error{The binding for the property 'aa' is part of a binding loop}
|
||||
|
||||
b: self.bb();
|
||||
// ^error{The binding for the property 'b' is part of a binding loop}
|
||||
// ^error{The binding for the property 'b' is part of a binding loop}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -8,10 +8,10 @@ Alias := Rectangle {
|
|||
|
||||
export Foo := Rectangle {
|
||||
property <int> base-prop: alias.viewport_width;
|
||||
// ^error{The binding for the property 'base-prop' is part of a binding loop}
|
||||
// ^error{The binding for the property 'base-prop' is part of a binding loop}
|
||||
|
||||
alias := Alias { ps_width: base-prop; }
|
||||
// ^error{The binding for the property 'ps-width' is part of a binding loop}
|
||||
// ^error{The binding for the property 'ps-width' is part of a binding loop}
|
||||
|
||||
Text {
|
||||
text: base-prop;
|
||||
|
|
|
|||
|
|
@ -2,16 +2,16 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||
|
||||
TC := Rectangle {
|
||||
// ^error{The binding for the property 'layoutinfo-h' is part of a binding loop}
|
||||
// ^error{The binding for the property 'layoutinfo-h' is part of a binding loop}
|
||||
outer := VerticalLayout {
|
||||
// ^error{The binding for the property 'width' is part of a binding loop}
|
||||
// ^^error{The binding for the property 'layoutinfo-h' is part of a binding loop}
|
||||
// ^error{The binding for the property 'width' is part of a binding loop}
|
||||
// ^^error{The binding for the property 'layoutinfo-h' is part of a binding loop}
|
||||
inner := HorizontalLayout {
|
||||
// ^error{The binding for the property 'width' is part of a binding loop}
|
||||
// ^^error{The binding for the property 'layoutinfo-h' is part of a binding loop}
|
||||
// ^error{The binding for the property 'width' is part of a binding loop}
|
||||
// ^^error{The binding for the property 'layoutinfo-h' is part of a binding loop}
|
||||
inner_inner := VerticalLayout {
|
||||
width: parent.width;
|
||||
// ^error{The binding for the property 'width' is part of a binding loop}
|
||||
// ^error{The binding for the property 'width' is part of a binding loop}
|
||||
Rectangle {}
|
||||
}
|
||||
}
|
||||
|
|
@ -25,28 +25,28 @@ export Test := Rectangle {
|
|||
// ^^error{The binding for the property 'min-width' is part of a binding loop}
|
||||
Rectangle {
|
||||
width: parent.min_width;
|
||||
// ^error{The binding for the property 'width' is part of a binding loop}
|
||||
// ^error{The binding for the property 'width' is part of a binding loop}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
l := HorizontalLayout {
|
||||
// ^error{The binding for the property 'layoutinfo-h' is part of a binding loop} // FIXME: That's an internal property, but people might understand
|
||||
// ^^error{The binding for the property 'preferred-width' is part of a binding loop}
|
||||
// ^^^error{The binding for the property 'layoutinfo-v' is part of a binding loop}
|
||||
// ^^^^error{The binding for the property 'preferred-height' is part of a binding loop}
|
||||
// ^^^^^error{The binding for the property 'width' is part of a binding loop}
|
||||
// ^^^^^^error{The binding for the property 'layout-cache' is part of a binding loop}
|
||||
// ^error{The binding for the property 'layoutinfo-h' is part of a binding loop} // FIXME: That's an internal property, but people might understand
|
||||
// ^^error{The binding for the property 'preferred-width' is part of a binding loop}
|
||||
// ^^^error{The binding for the property 'layoutinfo-v' is part of a binding loop}
|
||||
// ^^^^error{The binding for the property 'preferred-height' is part of a binding loop}
|
||||
// ^^^^^error{The binding for the property 'width' is part of a binding loop}
|
||||
// ^^^^^^error{The binding for the property 'layout-cache' is part of a binding loop}
|
||||
Text {
|
||||
text: "hello \{l.preferred-width/1px}x\{l.preferred-height/1px}";
|
||||
// ^error{The binding for the property 'text' is part of a binding loop}
|
||||
// ^error{The binding for the property 'text' is part of a binding loop}
|
||||
wrap: word-wrap;
|
||||
}
|
||||
}
|
||||
|
||||
tc := TC {
|
||||
// ^error{The binding for the property 'preferred-width' is part of a binding loop}
|
||||
// ^error{The binding for the property 'preferred-width' is part of a binding loop}
|
||||
width: preferred-width;
|
||||
// ^error{The binding for the property 'width' is part of a binding loop}
|
||||
// ^error{The binding for the property 'width' is part of a binding loop}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,9 +15,9 @@ Wrap := Rectangle {
|
|||
text: "Hello World";
|
||||
}
|
||||
square := Rectangle {
|
||||
// ^error{The binding for the property 'height' is part of a binding loop}
|
||||
// ^error{The binding for the property 'height' is part of a binding loop}
|
||||
width: height;
|
||||
// ^error{The binding for the property 'width' is part of a binding loop}
|
||||
// ^error{The binding for the property 'width' is part of a binding loop}
|
||||
background: violet;
|
||||
}
|
||||
}
|
||||
|
|
@ -38,7 +38,7 @@ export Test := Rectangle {
|
|||
}
|
||||
Rectangle {
|
||||
width: height;
|
||||
// ^error{The binding for the property 'width' is part of a binding loop}
|
||||
// ^error{The binding for the property 'width' is part of a binding loop}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,19 +2,19 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||
|
||||
Compo := Rectangle {
|
||||
// ^error{The binding for the property 'layoutinfo-h' is part of a binding loop}
|
||||
// ^error{The binding for the property 'layoutinfo-h' is part of a binding loop}
|
||||
|
||||
property <string> the_text;
|
||||
|
||||
lay := HorizontalLayout {
|
||||
// ^error{The binding for the property 'layoutinfo-h' is part of a binding loop}
|
||||
// ^error{The binding for the property 'layoutinfo-h' is part of a binding loop}
|
||||
if true : Rectangle {
|
||||
// ^error{The binding for the property 'layoutinfo-h' is part of a binding loop}
|
||||
VerticalLayout {
|
||||
// ^error{The binding for the property 'layoutinfo-h' is part of a binding loop}
|
||||
Text {
|
||||
text: root.the_text;
|
||||
// ^error{The binding for the property 'text' is part of a binding loop}
|
||||
// ^error{The binding for the property 'text' is part of a binding loop}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -26,6 +26,6 @@ export Foo := Rectangle {
|
|||
Compo {
|
||||
// ^error{The binding for the property 'preferred-width' is part of a binding loop}
|
||||
the_text: self.preferred-width / 1px;
|
||||
// ^error{The binding for the property 'the-text' is part of a binding loop}
|
||||
// ^error{The binding for the property 'the-text' is part of a binding loop}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@ component Foo {
|
|||
Text {
|
||||
text: "hello";
|
||||
font_size: self.width / 2.5;
|
||||
// ^error{The binding for the property 'font-size' is part of a binding loop}
|
||||
// ^^error{The binding for the property 'font-size' is part of a binding loop}
|
||||
// ^error{The binding for the property 'font-size' is part of a binding loop}
|
||||
// ^^error{The binding for the property 'font-size' is part of a binding loop}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -41,4 +41,3 @@ export component Apps inherits Window {
|
|||
// ^error{The binding for the property 'preferred-width' is part of a binding loop}
|
||||
// ^^error{The binding for the property 'width' is part of a binding loop}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,11 +10,11 @@ export Test := Rectangle {
|
|||
property <int> num_elements;
|
||||
num-elements: 4;
|
||||
Key { pos: 1; num_elements: num_elements; }
|
||||
// ^error{The binding for the property 'num-elements' is part of a binding loop}
|
||||
// ^error{The binding for the property 'num-elements' is part of a binding loop}
|
||||
Key { pos: 2; num_elements: self.num_elements; }
|
||||
// ^error{The binding for the property 'num-elements' is part of a binding loop}
|
||||
// ^error{The binding for the property 'num-elements' is part of a binding loop}
|
||||
Key { pos: 3; num_elements: parent.num_elements; }
|
||||
Key { pos: 4; num_elements: num_elements; }
|
||||
// ^error{The binding for the property 'num-elements' is part of a binding loop}
|
||||
// ^error{The binding for the property 'num-elements' is part of a binding loop}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ export SuperSimple := Rectangle {
|
|||
// ^error{catch-all property is only allowed within transitions}
|
||||
|
||||
animate background, foo { duration: 100ms; }
|
||||
// ^error{'foo' is not a property that can be animated}
|
||||
// ^error{'foo' is not a property that can be animated}
|
||||
|
||||
text := Text{ animate x { duration: 1000ms; } }
|
||||
animate text.x { duration: 100ms; }
|
||||
|
|
|
|||
|
|
@ -4,31 +4,31 @@
|
|||
export SuperSimple := Rectangle {
|
||||
property<duration> p1: 3s + 1ms;
|
||||
property<int> p2: 3s + 1;
|
||||
// ^error{Cannot convert float to duration}
|
||||
// ^error{Cannot convert float to duration}
|
||||
property<int> p3: 3s - 1;
|
||||
// ^error{Cannot convert float to duration}
|
||||
// ^error{Cannot convert float to duration}
|
||||
property<int> p4: 3 / 1ms;
|
||||
// ^error{Cannot convert \(ms⁻¹\) to int}
|
||||
// ^error{Cannot convert \(ms⁻¹\) to int}
|
||||
|
||||
property<duration> p5: 3ms * 1;
|
||||
property<duration> p6: 3ms * 1s;
|
||||
// ^error{Cannot convert \(ms²\) to duration}
|
||||
// ^error{Cannot convert \(ms²\) to duration}
|
||||
|
||||
property<int> p7: "hello" * 1;
|
||||
// ^error{Cannot convert string to float}
|
||||
|
||||
property<int> p8: 1 - "hello" - 1;
|
||||
// ^error{Cannot convert string to float}
|
||||
// ^error{Cannot convert string to float}
|
||||
|
||||
property<string> p9: 1 + "hello" + 1;
|
||||
property<int> p10: "hello" + 1ms;
|
||||
// ^error{Cannot convert duration to string}
|
||||
// ^error{Cannot convert duration to string}
|
||||
|
||||
property<length> p11: 1ms * 1px *3px / 1deg * 3 / (30px * 1s - 3px * 1ms) * 2deg;
|
||||
property<int> p12: 1ms * 3s / 3px / (2deg * 5turn) * 2s / 3phx;
|
||||
// ^error{Cannot convert \(ms³×phx⁻¹×px⁻¹×deg⁻²\) to int}
|
||||
// ^error{Cannot convert \(ms³×phx⁻¹×px⁻¹×deg⁻²\) to int}
|
||||
|
||||
property <brush> bru: background + background;
|
||||
// ^error{Cannot convert brush to float}
|
||||
// ^^error{Cannot convert brush to float}
|
||||
// ^^error{Cannot convert brush to float}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,11 +7,11 @@ Foo := Rectangle {
|
|||
|
||||
export SuperSimple := Window {
|
||||
drop-shadow-color: #00000080;
|
||||
// ^warning{The drop-shadow-color property cannot be used on the root element, the shadow will not be visible}
|
||||
// ^warning{The drop-shadow-color property cannot be used on the root element, the shadow will not be visible}
|
||||
|
||||
Text {
|
||||
drop-shadow-color: black;
|
||||
// ^error{The drop-shadow-color property is only supported on Rectangle elements right now}
|
||||
// ^error{The drop-shadow-color property is only supported on Rectangle elements right now}
|
||||
}
|
||||
|
||||
Foo {}
|
||||
|
|
|
|||
|
|
@ -6,11 +6,11 @@ MyTouchArea := TouchArea { }
|
|||
export SubElements := Rectangle {
|
||||
Rectangle {
|
||||
clip: 42;
|
||||
// ^error{Cannot convert float to bool}
|
||||
// ^error{Cannot convert float to bool}
|
||||
}
|
||||
Image {
|
||||
clip: false;
|
||||
// ^error{The 'clip' property can only be applied to a Rectangle or a Path for now}
|
||||
// ^error{The 'clip' property can only be applied to a Rectangle or a Path for now}
|
||||
}
|
||||
MyTouchArea {
|
||||
// ^error{The 'clip' property can only be applied to a Rectangle or a Path for now}
|
||||
|
|
|
|||
|
|
@ -4,21 +4,21 @@
|
|||
export SuperSimple := Rectangle {
|
||||
background: area.pressed ? green : blue;
|
||||
property<color> c2: area.pressed ? 123 : 456;
|
||||
// ^error{Cannot convert float to color}
|
||||
// ^error{Cannot convert float to color}
|
||||
|
||||
property<int> c3: area.pressed ? 123 : #456;
|
||||
// ^error{Cannot convert color to float}
|
||||
// ^^error{Cannot convert void to int}
|
||||
// ^^error{Cannot convert void to int}
|
||||
|
||||
property<int> c4: area.pressed ? 123ms : 123;
|
||||
// ^error{Cannot convert float to duration}
|
||||
// ^^error{Cannot convert void to int}
|
||||
// ^^error{Cannot convert void to int}
|
||||
|
||||
property <length> c5: true ? 123px : 0;
|
||||
|
||||
property<duration> c6: area.pressed ? 123ms : 123;
|
||||
// ^error{Cannot convert float to duration}
|
||||
// ^^error{Cannot convert void to duration}
|
||||
// ^^error{Cannot convert void to duration}
|
||||
|
||||
|
||||
area := TouchArea {
|
||||
|
|
@ -28,7 +28,7 @@ export SuperSimple := Rectangle {
|
|||
|
||||
export Test2 := Rectangle {
|
||||
background: {
|
||||
// ^error{Cannot convert void to brush}
|
||||
// ^error{Cannot convert void to brush}
|
||||
if (true) {
|
||||
} else {
|
||||
blue;
|
||||
|
|
@ -36,8 +36,8 @@ export Test2 := Rectangle {
|
|||
}
|
||||
|
||||
x: { if (false) {0}; }
|
||||
// ^error{Cannot convert void to length}
|
||||
// ^error{Cannot convert void to length}
|
||||
y: { if (false) {0px} else { return 5px; }; }
|
||||
property<length> something: { if (true) {"hello"} else { return 5px; }; }
|
||||
// ^error{Cannot convert string to length}
|
||||
// ^error{Cannot convert string to length}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,14 +11,14 @@ MyDiag1 := Dialog {
|
|||
}
|
||||
|
||||
MyDiag2 := Dialog {
|
||||
// ^error{A Dialog must have a single child element that is not StandardButton}
|
||||
// ^error{A Dialog must have a single child element that is not StandardButton}
|
||||
StandardButton { kind: reset; }
|
||||
StandardButton {
|
||||
kind: cancel;
|
||||
col: 42;
|
||||
// ^error{col used outside of a GridLayout}
|
||||
// ^error{col used outside of a GridLayout}
|
||||
rowspan: 2;
|
||||
// ^error{rowspan used outside of a GridLayout}
|
||||
// ^error{rowspan used outside of a GridLayout}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -28,9 +28,9 @@ MyDiag3 := Dialog {
|
|||
StandardButton { }
|
||||
// ^error{The `kind` property of the StandardButton in a Dialog must be set}
|
||||
StandardButton { kind: true ? ok : cancel; }
|
||||
// ^error{The `kind` property of the StandardButton in a Dialog must be known at compile-time}
|
||||
// ^error{The `kind` property of the StandardButton in a Dialog must be known at compile-time}
|
||||
StandardButton { kind: ok; }
|
||||
// ^error{Duplicated `kind`: There are two StandardButton in this Dialog with the same kind}
|
||||
// ^error{Duplicated `kind`: There are two StandardButton in this Dialog with the same kind}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -38,12 +38,12 @@ MyDialog4 := Dialog {
|
|||
StandardButton { kind: ok; }
|
||||
Rectangle { dialog-button-role: accept; }
|
||||
Rectangle { dialog-button-role: none; }
|
||||
// ^error{The `dialog-button-role` cannot be set explicitly to none}
|
||||
// ^error{The `dialog-button-role` cannot be set explicitly to none}
|
||||
Rectangle { dialog-button-role: true ? accept : reject; }
|
||||
// ^error{The `dialog-button-role` property must be known at compile-time}
|
||||
// ^error{The `dialog-button-role` property must be known at compile-time}
|
||||
Rectangle {
|
||||
Rectangle { dialog-button-role: accept; }
|
||||
// ^error{dialog-button-role used outside of a Dialog}
|
||||
// ^error{dialog-button-role used outside of a Dialog}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,11 +4,11 @@
|
|||
import { StandardButton } from "std-widgets.slint";
|
||||
|
||||
export Test := Dialog {
|
||||
// ^error{A Dialog must have a single child element that is not StandardButton}
|
||||
// ^error{A Dialog must have a single child element that is not StandardButton}
|
||||
StandardButton { kind: ok; }
|
||||
StandardButton { }
|
||||
// ^error{The `kind` property of the StandardButton in a Dialog must be set}
|
||||
StandardButton { kind: true ? ok : cancel; }
|
||||
// ^error{The `kind` property of the StandardButton in a Dialog must be known at compile-time}
|
||||
// ^error{The `kind` property of the StandardButton in a Dialog must be known at compile-time}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,39 +7,39 @@ SubElement := Rectangle {
|
|||
foo := Rectangle {
|
||||
background: yellow;
|
||||
hello := Rectangle {}
|
||||
// ^error{duplicated element id 'hello'}
|
||||
// ^error{duplicated element id 'hello'}
|
||||
}
|
||||
|
||||
unique := Rectangle {
|
||||
background: yellow;
|
||||
world := Rectangle {}
|
||||
// ^error{duplicated element id 'world'}
|
||||
// ^error{duplicated element id 'world'}
|
||||
}
|
||||
|
||||
if (true) : hello := Rectangle {
|
||||
// ^error{duplicated element id 'hello'}
|
||||
// ^error{duplicated element id 'hello'}
|
||||
world := Rectangle { }
|
||||
// ^error{duplicated element id 'world'}
|
||||
// ^error{duplicated element id 'world'}
|
||||
}
|
||||
|
||||
hello := Rectangle {}
|
||||
// ^error{duplicated element id 'hello'}
|
||||
// ^error{duplicated element id 'hello'}
|
||||
}
|
||||
|
||||
export TestCase := Rectangle {
|
||||
|
||||
unique := Rectangle {
|
||||
foo := SubElement { }
|
||||
// ^error{duplicated element id 'foo'}
|
||||
// ^error{duplicated element id 'foo'}
|
||||
}
|
||||
|
||||
bar := TouchArea {}
|
||||
// ^error{duplicated element id 'bar'}
|
||||
// ^error{duplicated element id 'bar'}
|
||||
|
||||
Rectangle {
|
||||
foo := Text {}
|
||||
// ^error{duplicated element id 'foo'}
|
||||
// ^error{duplicated element id 'foo'}
|
||||
bar := Text {}
|
||||
// ^error{duplicated element id 'bar'}
|
||||
// ^error{duplicated element id 'bar'}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ export X := Rectangle {
|
|||
animate y { easing: foo; }
|
||||
// ^error{Unknown unqualified identifier 'foo'}
|
||||
animate background { easing: a; }
|
||||
// ^error{Cannot convert int to easing}
|
||||
// ^error{Cannot convert int to easing}
|
||||
property <int> a; animate a { easing: cubic-bezier(0.01,1.46,0.94,1.37); }
|
||||
property <int> b; animate b { easing: cubic-bezier(0.01,1.46,0.94); }
|
||||
// ^error{Not enough arguments}
|
||||
|
|
|
|||
|
|
@ -10,17 +10,17 @@ export X := Rectangle {
|
|||
text: lay.foo + parent.width;
|
||||
// ^error{Element 'Row' does not have a property 'width'}
|
||||
colspan: 1 + 1;
|
||||
// ^error{'colspan' must be an integer literal}
|
||||
// ^error{'colspan' must be an integer literal}
|
||||
rowspan: 2;
|
||||
}
|
||||
Text {
|
||||
row: 3;
|
||||
col: -2;
|
||||
// ^error{'col' must be an integer literal}
|
||||
// ^error{'col' must be an integer literal}
|
||||
rowspan: 2.2;
|
||||
// ^error{'rowspan' must be a positive integer}
|
||||
// ^error{'rowspan' must be a positive integer}
|
||||
y: 0;
|
||||
// ^error{The property 'y' cannot be set for elements placed in a layout, because the layout is already setting it}
|
||||
// ^error{The property 'y' cannot be set for elements placed in a layout, because the layout is already setting it}
|
||||
|
||||
animate x { duration: 100ms; }
|
||||
// ^error{The property 'x' cannot be set for elements placed in a layout, because the layout is already setting it}
|
||||
|
|
@ -29,19 +29,19 @@ export X := Rectangle {
|
|||
Row {
|
||||
Text {
|
||||
x: 12px;
|
||||
// ^error{The property 'x' cannot be set for elements placed in a layout, because the layout is already setting it}
|
||||
// ^error{The property 'x' cannot be set for elements placed in a layout, because the layout is already setting it}
|
||||
}}
|
||||
Text{
|
||||
row: 200000; // that's actually bigger than 65535
|
||||
// ^error{'row' must be a positive integer}
|
||||
// ^error{'row' must be a positive integer}
|
||||
Rectangle { row: 3; }
|
||||
// ^error{row used outside of a GridLayout}
|
||||
// ^error{row used outside of a GridLayout}
|
||||
}
|
||||
}
|
||||
|
||||
Text { colspan: 3; }
|
||||
// ^error{colspan used outside of a GridLayout}
|
||||
// ^error{colspan used outside of a GridLayout}
|
||||
col: 3;
|
||||
// ^error{col used outside of a GridLayout}
|
||||
// ^error{col used outside of a GridLayout}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@
|
|||
|
||||
export H := Rectangle {
|
||||
x: {foo: "42"};
|
||||
// ^error{Cannot convert \{ foo: string,\} to length}
|
||||
// ^error{Cannot convert \{ foo: string,\} to length}
|
||||
y: [ 45, 45, 45, 45 ];
|
||||
// ^error{Cannot convert \[float\] to length}
|
||||
// ^error{Cannot convert \[float\] to length}
|
||||
background: [ { a: 45, b: 55, }, {a: 44, b: 54},];
|
||||
// ^error{Cannot convert \[\{ a: float,b: float,\}\] to brush}
|
||||
// ^error{Cannot convert \[\{ a: float,b: float,\}\] to brush}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,14 +4,14 @@
|
|||
export SuperSimple := Window {
|
||||
|
||||
opacity: 0.5;
|
||||
// ^warning{The opacity property cannot be used on the root element, it will not be applied}
|
||||
// ^warning{The opacity property cannot be used on the root element, it will not be applied}
|
||||
|
||||
Rectangle {
|
||||
opacity: false;
|
||||
// ^error{Cannot convert bool to float}
|
||||
// ^error{Cannot convert bool to float}
|
||||
}
|
||||
|
||||
visible: false;
|
||||
// ^warning{The visible property cannot be used on the root element, it will not be applied}
|
||||
// ^warning{The visible property cannot be used on the root element, it will not be applied}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ Test2 := Path {
|
|||
width: 640px;
|
||||
height: 480px;
|
||||
commands: "M 0 0 M -100 0 A 100 100 0 1 0 100 0 Å 100 100 0 1 0 100 0 Z";
|
||||
// ^error{Error parsing SVG commands}
|
||||
// ^error{Error parsing SVG commands}
|
||||
}
|
||||
|
||||
export TestCase := Rectangle {
|
||||
|
|
@ -13,7 +13,7 @@ export TestCase := Rectangle {
|
|||
width: 100px;
|
||||
height: 100px;
|
||||
commands: "hello world";
|
||||
// ^error{Error parsing SVG commands}
|
||||
// ^error{Error parsing SVG commands}
|
||||
stroke: red;
|
||||
stroke-width: 1px;
|
||||
}
|
||||
|
|
@ -28,7 +28,7 @@ export TestCase := Rectangle {
|
|||
width: 640px;
|
||||
height: 480px;
|
||||
commands: "M 0 0 M -100 0 A 100 100 0 1 0 0 A 100 100 0 1 0 100 0 Z";
|
||||
// ^error{Error parsing SVG commands}
|
||||
// ^error{Error parsing SVG commands}
|
||||
}
|
||||
|
||||
Test2 {}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ Foo := Rectangle {
|
|||
width: 30%;
|
||||
|
||||
preferred-width: 50%;
|
||||
// ^error{preferred-width must either be a length, or the literal '100%'}
|
||||
// ^error{preferred-width must either be a length, or the literal '100%'}
|
||||
|
||||
|
||||
Rectangle {
|
||||
|
|
@ -13,19 +13,19 @@ Foo := Rectangle {
|
|||
}
|
||||
|
||||
x: 30%;
|
||||
// ^error{Automatic conversion from percentage to length is only possible for the following properties: width, height, preferred-width, preferred-height}
|
||||
// ^error{Automatic conversion from percentage to length is only possible for the following properties: width, height, preferred-width, preferred-height}
|
||||
}
|
||||
|
||||
export X := Rectangle {
|
||||
height: 30%;
|
||||
// ^error{Cannot find parent property to apply relative length}
|
||||
// ^error{Cannot find parent property to apply relative length}
|
||||
Foo {
|
||||
background: 30%;
|
||||
// ^error{Cannot convert percent to brush}
|
||||
// ^error{Cannot convert percent to brush}
|
||||
y: 30%;
|
||||
// ^error{Automatic conversion from percentage to length is only possible for the following properties: width, height, preferred-width, preferred-height}
|
||||
// ^error{Automatic conversion from percentage to length is only possible for the following properties: width, height, preferred-width, preferred-height}
|
||||
|
||||
preferred-height: 50%;
|
||||
// ^error{preferred-height must either be a length, or the literal '100%'}
|
||||
// ^error{preferred-height must either be a length, or the literal '100%'}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,12 +3,12 @@
|
|||
|
||||
|
||||
export X := PopupWindow {
|
||||
// ^error{PopupWindow cannot be the top level}
|
||||
// ^error{PopupWindow cannot be the top level}
|
||||
|
||||
Rectangle {
|
||||
|
||||
popup := PopupWindow {
|
||||
// ^error{Cannot access the inside of a PopupWindow from enclosing component}
|
||||
// ^error{Cannot access the inside of a PopupWindow from enclosing component}
|
||||
r := Rectangle {
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ export Ex1 := Rectangle {
|
|||
Rectangle {
|
||||
rotation-origin-x: width / 2;
|
||||
rotation-angle: 45deg;
|
||||
// ^error{rotation properties can only be applied to the Image element}
|
||||
// ^error{rotation properties can only be applied to the Image element}
|
||||
rotation-origin-y: width / 2;
|
||||
}
|
||||
Rectangle {
|
||||
|
|
@ -31,7 +31,7 @@ export Ex2 := Rectangle {
|
|||
rotation-angle: 45deg;
|
||||
Rectangle {}
|
||||
}
|
||||
RotImg {
|
||||
RotImg {
|
||||
// ^error{Elements with rotation properties cannot have children elements}
|
||||
Rectangle {}
|
||||
}
|
||||
|
|
@ -49,11 +49,11 @@ export Ex2 := Rectangle {
|
|||
|
||||
export Ex3 := Rectangle {
|
||||
i1 := Image {
|
||||
// ^error{Elements with rotation properties cannot have children elements}
|
||||
// ^error{Elements with rotation properties cannot have children elements}
|
||||
Rectangle {}
|
||||
}
|
||||
i2 := Rectangle {}
|
||||
// ^error{rotation properties can only be applied to the Image element}
|
||||
// ^error{rotation properties can only be applied to the Image element}
|
||||
|
||||
TouchArea {
|
||||
clicked => {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ Base := Rectangle {
|
|||
export SubElements := Rectangle {
|
||||
callback foobar;
|
||||
callback foobar;
|
||||
// ^error{Duplicated callback declaration}
|
||||
// ^error{Duplicated callback declaration}
|
||||
|
||||
callback callback_with_arg(int, string);
|
||||
|
||||
|
|
@ -43,13 +43,13 @@ export SubElements := Rectangle {
|
|||
|
||||
Base {
|
||||
callback blah;
|
||||
// ^error{Cannot override callback 'blah'}
|
||||
// ^error{Cannot override callback 'blah'}
|
||||
}
|
||||
|
||||
property <bool> pressed;
|
||||
callback pressed;
|
||||
// ^error{Cannot declare callback 'pressed' when a property with the same name exists}
|
||||
// ^error{Cannot declare callback 'pressed' when a property with the same name exists}
|
||||
|
||||
callback init;
|
||||
// ^error{Cannot override callback 'init'}
|
||||
// ^error{Cannot override callback 'init'}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,11 +31,11 @@ export TestCase := Rectangle {
|
|||
}
|
||||
out pressed: {
|
||||
animate color, foo.x { duration: 300ms; }
|
||||
/// ^error{'foo' is not a valid element id}
|
||||
/// ^error{'foo' is not a valid element id}
|
||||
//pause: 20ms;
|
||||
animate border { duration: 120ms; }
|
||||
animate color, text.text { duration: 300ms; }
|
||||
/// ^error{'text.text' is not a property that can be animated}
|
||||
/// ^error{'text.text' is not a property that can be animated}
|
||||
|
||||
}
|
||||
]
|
||||
|
|
@ -74,10 +74,10 @@ export component NewSyntax {
|
|||
}
|
||||
out {
|
||||
animate color, foo.x { duration: 300ms; }
|
||||
/// ^error{'foo' is not a valid element id}
|
||||
/// ^error{'foo' is not a valid element id}
|
||||
animate border { duration: 120ms; }
|
||||
animate color, text.text { duration: 300ms; }
|
||||
/// ^error{'text.text' is not a property that can be animated}
|
||||
/// ^error{'text.text' is not a property that can be animated}
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
@ -119,10 +119,10 @@ export component OldInNewSyntax {
|
|||
}
|
||||
out pressed: {
|
||||
animate color, foo.x { duration: 300ms; }
|
||||
/// ^error{'foo' is not a valid element id}
|
||||
/// ^error{'foo' is not a valid element id}
|
||||
animate border { duration: 120ms; }
|
||||
animate color, text.text { duration: 300ms; }
|
||||
/// ^error{'text.text' is not a property that can be animated}
|
||||
/// ^error{'text.text' is not a property that can be animated}
|
||||
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ export TestCase := Rectangle {
|
|||
|
||||
transitions [
|
||||
in does_not_exist: {
|
||||
// ^error{State 'does-not-exist' does not exist}
|
||||
// ^error{State 'does-not-exist' does not exist}
|
||||
animate * { }
|
||||
}
|
||||
in checked: {
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ export SuperSimple := Rectangle {
|
|||
}
|
||||
|
||||
dd := DoesNotExist2 {
|
||||
// ^error{Unknown type DoesNotExist2}
|
||||
// ^error{Unknown type DoesNotExist2}
|
||||
abc: 42;
|
||||
Hallo {}
|
||||
// ^error{Unknown type Hallo}
|
||||
|
|
@ -29,7 +29,7 @@ export SuperSimple := Rectangle {
|
|||
}
|
||||
|
||||
s := Struct {
|
||||
// ^error{'Struct' cannot be used as an element}
|
||||
// ^error{'Struct' cannot be used as an element}
|
||||
def: "42";
|
||||
xyz: "42";
|
||||
Hallo {}
|
||||
|
|
|
|||
|
|
@ -10,5 +10,5 @@ global Singleton := {
|
|||
|
||||
export Test := Rectangle {
|
||||
callback init;
|
||||
// ^error{Cannot override callback 'init'}
|
||||
// ^error{Cannot override callback 'init'}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,12 +7,12 @@ export Test2 := Rectangle {
|
|||
TabWidget {
|
||||
Tab {
|
||||
visible: false;
|
||||
// ^error{The property 'visible' cannot be set for Tabs inside a TabWidget}
|
||||
// ^error{The property 'visible' cannot be set for Tabs inside a TabWidget}
|
||||
Rectangle { }
|
||||
}
|
||||
f := Tab {
|
||||
height: 50%;
|
||||
// ^error{The property 'height' cannot be set for Tabs inside a TabWidget}
|
||||
// ^error{The property 'height' cannot be set for Tabs inside a TabWidget}
|
||||
}
|
||||
Tab {
|
||||
Rectangle { }
|
||||
|
|
|
|||
|
|
@ -8,4 +8,4 @@ export Test3 := Rectangle {
|
|||
}
|
||||
|
||||
export Foo := TabWidget { }
|
||||
// ^error{Unknown type TabWidget. \(The type exist as an internal type, but cannot be accessed in this scope\)}
|
||||
// ^error{Unknown type TabWidget. \(The type exist as an internal type, but cannot be accessed in this scope\)}
|
||||
|
|
|
|||
|
|
@ -5,10 +5,10 @@ Foo := Rectangle {}
|
|||
Bar := Rectangle {}
|
||||
|
||||
export { Foo }
|
||||
// ^error{Duplicated export 'Foo'}
|
||||
// ^error{Duplicated export 'Foo'}
|
||||
export { Foo }
|
||||
// ^error{Duplicated export 'Foo'}
|
||||
// ^error{Duplicated export 'Foo'}
|
||||
export { Bar }
|
||||
// ^error{Duplicated export 'Bar'}
|
||||
// ^error{Duplicated export 'Bar'}
|
||||
export { Foo as Bar }
|
||||
// ^error{Duplicated export 'Bar'}
|
||||
// ^error{Duplicated export 'Bar'}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ export X := Rectangle {
|
|||
}
|
||||
}
|
||||
x: edit.focus;
|
||||
// ^error{Cannot convert function\(element ref\) -> void to length}
|
||||
// ^error{Cannot convert function\(element ref\) -> void to length}
|
||||
// ^^error{'edit.focus' must be called. Did you forgot the '\(\)'\?}
|
||||
// ^^^warning{Call of impure function}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
export X := Rectangle {
|
||||
forward-focus: someRect;
|
||||
// ^error{element is not focusable}
|
||||
// ^error{element is not focusable}
|
||||
|
||||
callback trigger_focus_change();
|
||||
trigger_focus_change => {
|
||||
|
|
@ -14,7 +14,7 @@ export X := Rectangle {
|
|||
|
||||
indirect_focus_chain_rect := Rectangle {
|
||||
forward-focus: someRect;
|
||||
// ^error{element is not focusable}
|
||||
// ^error{element is not focusable}
|
||||
}
|
||||
|
||||
callback trigger_focus_change_2();
|
||||
|
|
@ -36,7 +36,7 @@ export X := Rectangle {
|
|||
|
||||
export Y := FocusScope {
|
||||
forward-focus: self;
|
||||
// ^error{forward-focus can't refer to itself}
|
||||
// ^error{forward-focus can't refer to itself}
|
||||
x:= X { }
|
||||
key-pressed => {
|
||||
r0.focus();
|
||||
|
|
@ -56,6 +56,6 @@ export Y := FocusScope {
|
|||
}
|
||||
r3 := Rectangle {
|
||||
forward-focus: r1;
|
||||
// ^error{forward-focus loop}
|
||||
// ^error{forward-focus loop}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,19 +24,19 @@ export Xxx := Rectangle {
|
|||
|
||||
|
||||
function background() {}
|
||||
// ^error{Cannot declare function 'background' when a property with the same name exists}
|
||||
// ^error{Cannot declare function 'background' when a property with the same name exists}
|
||||
|
||||
|
||||
Abc {
|
||||
property <int> par;
|
||||
// ^error{Cannot declare property 'par' when a callback with the same name exists}
|
||||
callback par();
|
||||
// ^error{Cannot declare callback 'par' when a function with the same name exists}
|
||||
// ^error{Cannot declare callback 'par' when a function with the same name exists}
|
||||
}
|
||||
|
||||
TouchArea {
|
||||
function clicked() {}
|
||||
// ^error{Cannot override 'clicked'}
|
||||
// ^error{Cannot override 'clicked'}
|
||||
}
|
||||
|
||||
Abc { par => {} }
|
||||
|
|
|
|||
|
|
@ -4,6 +4,6 @@
|
|||
import { Rec12 } from "../../typeloader/recursive_import1.slint";
|
||||
// ^error{No exported type called 'Rec12' found in ".*recursive_import1.slint"}
|
||||
export Blah := Rec12 {
|
||||
// ^error{Unknown type Rec12}
|
||||
// ^error{Unknown type Rec12}
|
||||
width: 100px;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,14 +2,14 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||
|
||||
export { Foo as Bar }
|
||||
// ^error{'Foo' not found}
|
||||
// ^error{'Foo' not found}
|
||||
|
||||
export { Image as Plop }
|
||||
// ^error{Cannot export 'Image' because it is not a component}
|
||||
// ^error{Cannot export 'Image' because it is not a component}
|
||||
|
||||
export { string as Boob }
|
||||
// ^error{Cannot export 'string' because it is not a component}
|
||||
// ^error{Cannot export 'string' because it is not a component}
|
||||
|
||||
export Hello := Plop {
|
||||
// ^error{Unknown type Plop}
|
||||
// ^error{Unknown type Plop}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,13 +6,13 @@ export Test := Rectangle {
|
|||
GridLayout {
|
||||
Rectangle {
|
||||
height: 42px;
|
||||
// ^error{Cannot specify both 'height' and 'min-height'}
|
||||
// ^error{Cannot specify both 'height' and 'min-height'}
|
||||
min-height: 42px;
|
||||
max-width: 42px;
|
||||
}
|
||||
Rectangle {
|
||||
width: 42px;
|
||||
// ^error{Cannot specify both 'width' and 'max-width'}
|
||||
// ^error{Cannot specify both 'width' and 'max-width'}
|
||||
min-height: 42px;
|
||||
max-width: 42px;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ export X := Rectangle {
|
|||
// ^error{Invalid color literal}
|
||||
|
||||
property<color> b: 123;
|
||||
// ^error{Cannot convert float to color}
|
||||
// ^error{Cannot convert float to color}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
|
|
|
|||
|
|
@ -3,13 +3,13 @@
|
|||
|
||||
global Glob := {
|
||||
property <physical_length> len: 45px * 5;
|
||||
// ^error{Cannot convert between logical and physical length in a global component, because the scale factor is not known}
|
||||
// ^error{Cannot convert between logical and physical length in a global component, because the scale factor is not known}
|
||||
property <length> logic_len: 45phx * 5;
|
||||
// ^error{Cannot convert between logical and physical length in a global component, because the scale factor is not known}
|
||||
// ^error{Cannot convert between logical and physical length in a global component, because the scale factor is not known}
|
||||
property <float> ratio: allowed / 1phx;
|
||||
// ^error{Cannot convert between logical and physical length in a global component, because the scale factor is not known}
|
||||
// ^error{Cannot convert between logical and physical length in a global component, because the scale factor is not known}
|
||||
property <length> converted_rem: 2rem;
|
||||
// ^error{Cannot convert between rem and logical length in a global component, because the default font size is not known}
|
||||
// ^error{Cannot convert between rem and logical length in a global component, because the default font size is not known}
|
||||
property <float> should_work: 45px / 8px + (4rem / 2rem);
|
||||
property <length> allowed: 45px * 5;
|
||||
property <relative-font-size> rem_allowed: 42rem;
|
||||
|
|
@ -19,34 +19,34 @@ export X := Rectangle {
|
|||
|
||||
t := Text {
|
||||
x: "hello";
|
||||
// ^error{Cannot convert string to length$}
|
||||
// ^error{Cannot convert string to length$}
|
||||
text: 45;
|
||||
}
|
||||
|
||||
Text {
|
||||
x: t.text;
|
||||
// ^error{Cannot convert string to length$}
|
||||
// ^error{Cannot convert string to length$}
|
||||
y: 42;
|
||||
// ^error{Cannot convert float to length. Use an unit, or multiply by 1px to convert explicitly}
|
||||
// ^error{Cannot convert float to length. Use an unit, or multiply by 1px to convert explicitly}
|
||||
text: x;
|
||||
// ^error{Cannot convert length to string. Divide by 1px to convert to a plain number}
|
||||
// ^error{Cannot convert length to string. Divide by 1px to convert to a plain number}
|
||||
property<int> foo: y;
|
||||
// ^error{Cannot convert length to int. Divide by 1px to convert to a plain number}
|
||||
// ^error{Cannot convert length to int. Divide by 1px to convert to a plain number}
|
||||
property<duration> bar: foo;
|
||||
// ^error{Cannot convert int to duration. Use an unit, or multiply by 1ms to convert explicitly}
|
||||
// ^error{Cannot convert int to duration. Use an unit, or multiply by 1ms to convert explicitly}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
background: "blue";
|
||||
// ^error{Cannot convert string to brush$}
|
||||
// ^error{Cannot convert string to brush$}
|
||||
property<length> no_matching_parent: 50%;
|
||||
// ^error{Automatic conversion from percentage to length is only possible for the following properties: width, height, preferred-width, preferred-height}
|
||||
// ^error{Automatic conversion from percentage to length is only possible for the following properties: width, height, preferred-width, preferred-height}
|
||||
}
|
||||
|
||||
property <{a: string, b: int}> object1: { a: "123", typo: 42};
|
||||
// ^error{Cannot convert \{ a: string,typo: float,\} to \{ a: string,b: int,\}}
|
||||
// ^error{Cannot convert \{ a: string,typo: float,\} to \{ a: string,b: int,\}}
|
||||
|
||||
property <[{a: [int]}]> ccc: [{a: []}, {}, {a: ["123"]}, {a: [123]}];
|
||||
// ^error{Cannot convert string to int} (FIXME: error location)
|
||||
// ^error{Cannot convert string to int} (FIXME: error location)
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ export Hello := Rectangle {
|
|||
x: plop * 1phx;
|
||||
Rectangle {
|
||||
background: plop;
|
||||
// ^error{Cannot convert float to brush}
|
||||
// ^error{Cannot convert float to brush}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -57,9 +57,9 @@ export Hello := Rectangle {
|
|||
x: pp.a;
|
||||
text: pp.b;
|
||||
y: pp.b;
|
||||
// ^error{Cannot convert string to length}
|
||||
// ^error{Cannot convert string to length}
|
||||
property<int> ggg: pp;
|
||||
// ^error{Cannot convert \{ a: physical-length,b: string,\} to int}
|
||||
// ^error{Cannot convert \{ a: physical-length,b: string,\} to int}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ export component Compo inherits Text {
|
|||
|
||||
Rectangle {
|
||||
background: background;
|
||||
// ^error{Cannot convert string to brush}
|
||||
// ^error{Cannot convert string to brush}
|
||||
}
|
||||
|
||||
Text {
|
||||
|
|
@ -23,7 +23,7 @@ export component Compo inherits Text {
|
|||
width: border-color;
|
||||
// ^error{Unknown unqualified identifier 'border-color'$}
|
||||
height: text;
|
||||
// ^error{Cannot convert color to length}
|
||||
// ^error{Cannot convert color to length}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,6 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||
|
||||
export X := SomeRect {
|
||||
// ^error{Unknown type SomeRect}
|
||||
// ^error{Unknown type SomeRect}
|
||||
foo: 42;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
export X := Rectangle {
|
||||
eh := Invalid {
|
||||
// ^error{Unknown type Invalid}
|
||||
// ^error{Unknown type Invalid}
|
||||
foo: 42;
|
||||
}
|
||||
width: eh.bhal;
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ export Unused := Rectangle {
|
|||
|
||||
export Z := Rectangle {
|
||||
property <int> b1: b2;
|
||||
//^error{loop}
|
||||
//^error{loop}
|
||||
property <int> b2: b1;
|
||||
//^error{loop}
|
||||
//^error{loop}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1605,7 +1605,7 @@ mod tests {
|
|||
fn test_element_at_position_root() {
|
||||
let (mut dc, url, _) = complex_document_cache("fluent");
|
||||
|
||||
assert_eq!(id_at_position(&mut dc, &url, 2, 29), Some("root".to_string())); // TODO: Seems one char too early..
|
||||
assert_eq!(id_at_position(&mut dc, &url, 2, 30), Some("root".to_string()));
|
||||
assert_eq!(id_at_position(&mut dc, &url, 2, 32), Some("root".to_string()));
|
||||
assert_eq!(id_at_position(&mut dc, &url, 2, 42), Some("root".to_string()));
|
||||
assert_eq!(id_at_position(&mut dc, &url, 3, 0), Some("root".to_string()));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue