First stage of cleaning up the export handling of the slint root component (#2095)

We implicitly export the last component of a .slint file to the generator.
Issue a warning when that happens and suggest to export it explicitly.
This commit is contained in:
Simon Hausmann 2023-01-23 15:19:49 +01:00 committed by GitHub
parent 33d68687c2
commit 24dcef5fed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
130 changed files with 175 additions and 143 deletions

View file

@ -200,7 +200,7 @@ pub struct UsedSubTypes {
/// Or is materialized for repeated expression.
#[derive(Default, Debug)]
pub struct Component {
// node: SyntaxNode,
pub node: Option<SyntaxNode>,
pub id: String,
pub root_element: ElementRc,
@ -254,6 +254,7 @@ impl Component {
let mut child_insertion_point = None;
let is_legacy_syntax = node.child_token(SyntaxKind::ColonEqual).is_some();
let c = Component {
node: Some(node.clone().into()),
id: parser::identifier_text(&node.DeclaredIdentifier()).unwrap_or_default(),
root_element: Element::from_node(
node.Element(),
@ -2215,6 +2216,15 @@ impl Exports {
if sorted_deduped_exports.is_empty() {
if let Some(last_compo) = inner_components.last() {
if last_compo.is_global() {
diag.push_warning(
"Global singleton is implicitly marked for export. This is deprecated and it should be explicitly exported"
.into(),
&last_compo.node,
);
} else {
diag.push_warning("Component is implicitly marked for export. This is deprecated and it should be explicitly exported".into(), &last_compo.node)
}
let name = last_compo.id.clone();
sorted_deduped_exports.push((
ExportedName { name, name_ident: doc.clone().into() },

View file

@ -268,6 +268,7 @@ fn duplicate_sub_component(
) -> Rc<Component> {
debug_assert!(component_to_duplicate.parent_element.upgrade().is_some());
let new_component = Component {
node: component_to_duplicate.node.clone(),
id: component_to_duplicate.id.clone(),
root_element: duplicate_element_with_mapping(
&component_to_duplicate.root_element,

View file

@ -19,7 +19,7 @@ Button3 := Rectangle {
}
}
Test := Window {
export Test := Window {
Button1 { }
Button1 { accessible-description: "ok"; } // ok because Button1 has a role

View file

@ -14,7 +14,7 @@ WithStates := Rectangle {
]
}
Test := Rectangle {
export Test := Rectangle {
property <int> a: 45 + root.b;
// ^error{The binding for the property 'a' is part of a binding loop}

View file

@ -35,7 +35,7 @@ T4 := Rectangle {
property <length> my_property <=> x;
}
App := Rectangle {
export App := Rectangle {
VerticalLayout {

View file

@ -18,7 +18,7 @@ Compo1 := Rectangle {
// ^error{The binding for the property 'bb' is part of a binding loop}
}
App := Rectangle {
export App := Rectangle {
cc := Compo1 {
aa() => { return self.a; }
// ^error{The binding for the property 'aa' is part of a binding loop}
@ -29,4 +29,4 @@ App := Rectangle {
}
}

View file

@ -6,7 +6,7 @@ Alias := Rectangle {
property <int> ps_width <=> viewport_width;
}
Foo := 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}

View file

@ -19,7 +19,7 @@ TC := Rectangle {
}
Test := Rectangle {
export Test := Rectangle {
VerticalLayout {
// ^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 'min-width' is part of a binding loop}

View file

@ -26,7 +26,7 @@ Wrap := Rectangle {
property <bool> test: square.width == square.height;
}
Test := Rectangle {
export Test := Rectangle {
property <image> source;
GridLayout {
// ^error{The binding for the property 'layout-cache-h' is part of a binding loop}

View file

@ -22,7 +22,7 @@ Compo := Rectangle {
}
Foo := Rectangle {
export Foo := Rectangle {
Compo {
// ^error{The binding for the property 'preferred-width' is part of a binding loop}
the_text: self.preferred-width / 1px;

View file

@ -5,7 +5,7 @@
Key := Rectangle { property <int> pos; property <int> num_elements; }
Test := Rectangle {
export Test := Rectangle {
Rectangle {
property <int> num_elements;
num-elements: 4;

View file

@ -1,7 +1,7 @@
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
SuperSimple := Rectangle {
export SuperSimple := Rectangle {
animate x {
duration: 1000ms;

View file

@ -1,7 +1,7 @@
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
SuperSimple := Rectangle {
export SuperSimple := Rectangle {
property<duration> p1: 3s + 1ms;
property<int> p2: 3s + 1;
// ^error{Cannot convert float to duration}

View file

@ -1,7 +1,7 @@
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
Test := Window {
export Test := Window {
a: [,];
// ^error{invalid expression}
}

View file

@ -1,7 +1,7 @@
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
SuperSimple := Rectangle {
export SuperSimple := Rectangle {
TouchArea {
clicked => { root.x = 1phx; }
}

View file

@ -5,7 +5,7 @@ Foo := Rectangle {
drop-shadow-color: red;
}
SuperSimple := Window {
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}

View file

@ -33,7 +33,7 @@ TestBox2 := Rectangle {
// ^error{The @children placeholder can only appear once in an element hierarchy}
}
Final := TestBox {
export Final := TestBox {
Rectangle {
@children
// ^error{children placeholder not allowed in the final component}

View file

@ -1,7 +1,7 @@
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
Final := Window {
export Final := Window {
VerticalLayout {
@children
// ^error{children placeholder not allowed in the final component}

View file

@ -3,7 +3,7 @@
MyTouchArea := TouchArea { }
SubElements := Rectangle {
export SubElements := Rectangle {
Rectangle {
clip: 42;
// ^error{Cannot convert float to bool}

View file

@ -4,7 +4,7 @@
// comment
// line comment
SuperSimple := Rectangle {
export SuperSimple := Rectangle {
/* block comment */
background: green;

View file

@ -1,7 +1,7 @@
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
SuperSimple := Rectangle {
export SuperSimple := Rectangle {
property<bool> zz: aa > bb == cc
// ^error{Use parentheses to disambiguate equality expression on the same level}
< dd;

View file

@ -26,7 +26,7 @@ SuperSimple := Rectangle {
}
Test2 := Rectangle {
export Test2 := Rectangle {
background: {
// ^error{Cannot convert void to brush}
if (true) {

View file

@ -47,7 +47,7 @@ MyDialog4 := Dialog {
}
}
Test := Rectangle {
export Test := Rectangle {
MyDiag1 {}
MyDiag2 {}
MyDiag3 {}

View file

@ -3,8 +3,8 @@
import { StandardButton } from "std-widgets.slint";
Test := Dialog {
// ^error{A Dialog must have a single child element that is not StandardButton}
export Test := Dialog {
// ^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}

View file

@ -1,7 +1,7 @@
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
X := Rectangle {
export X := Rectangle {
x: 42phx;
x: 32phx;

View file

@ -2,7 +2,7 @@
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
SuperSimple := Rectangle {
export SuperSimple := Rectangle {
background: green;
background: red;
// ^error{Duplicated property}

View file

@ -26,7 +26,7 @@ SubElement := Rectangle {
// ^error{duplicated element id 'hello'}
}
TestCase := Rectangle {
export TestCase := Rectangle {
unique := Rectangle {
foo := SubElement { }

View file

@ -1,7 +1,7 @@
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
X := Rectangle {
export X := Rectangle {
animate x { easing: ease-in; }
animate y { easing: foo; }
// ^error{Unknown unqualified identifier 'foo'}

View file

@ -3,7 +3,7 @@
// Cannot be put in the easing.slint test because it is in a different pass
X := Rectangle {
export X := Rectangle {
property <int> g; animate g { easing: cubic-bezier; }
// ^error{must be called}
}

View file

@ -2,7 +2,7 @@
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
SuperSimple := Rectangle {
export SuperSimple := Rectangle {
background: green;
for xx Text {}

View file

@ -2,7 +2,7 @@
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
SubElements := Rectangle {
export SubElements := Rectangle {
background: blue;

View file

@ -7,7 +7,7 @@ Inline1 := Rectangle {
}
}
SubElements := Rectangle {
export SubElements := Rectangle {
Inline1 {
background: yellow;
invalid: yellow;

View file

@ -19,7 +19,7 @@ Comp := Rectangle {
// ^error{'Rectangle' is not a valid type}
}
Foo := Rectangle {
export Foo := Rectangle {
xx := Rectangle { }
Comp {
r: xx;

View file

@ -1,7 +1,7 @@
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
X := Rectangle {
export X := Rectangle {
lay := GridLayout {
property<string> foo: "hello";

View file

@ -1,7 +1,7 @@
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
X := Rectangle {
export X := Rectangle {
lay := GridLayout {
property<string> foo: "hello";

View file

@ -1,7 +1,7 @@
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
X := Rectangle {
export X := Rectangle {
property<brush> g1: @linear-gradient();
// ^error{Expected angle expression}
property<brush> g2: @linear-gradient(to left, blue, red);

View file

@ -6,7 +6,7 @@ global Plop := {
// ^error{Builtin function must be called}
}
SuperSimple := Rectangle {
export SuperSimple := Rectangle {
property <int> a: max + max() + max(45, "hello");
// ^error{Builtin function must be called}
// ^^error{Needs at least one argument}

View file

@ -1,7 +1,7 @@
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
H := Rectangle {
export H := Rectangle {
x: {foo: "42"};
// ^error{Cannot convert \{ foo: string,\} to length}
y: [ 45, 45, 45, 45 ];

View file

@ -1,7 +1,7 @@
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
SuperSimple := Window {
export SuperSimple := Window {
opacity: 0.5;
// ^warning{The opacity property cannot be used on the root element, it will not be applied}

View file

@ -1,7 +1,7 @@
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
SuperSimple := Rectangle {
export SuperSimple := Rectangle {
88;
// ^error{Parse error}
* / - + // no error there as this is already reported in the previous line

View file

@ -2,7 +2,7 @@
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
TestCase := Rectangle {
export TestCase := Rectangle {
Path {
LineTo { x: 100; y: 0; }
LineTo { x: 100; y: 0; }

View file

@ -8,7 +8,7 @@ Test2 := Path {
// ^error{Error parsing SVG commands}
}
TestCase := Rectangle {
export TestCase := Rectangle {
Path {
width: 100px;
height: 100px;

View file

@ -2,7 +2,7 @@
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
TestCase := Rectangle {
export TestCase := Rectangle {
Path {
MoveTo {
x: 0;

View file

@ -12,7 +12,7 @@ Foo := Rectangle {
// ^error{conversion from percentage to length is only possible for the properties width and height}
}
X := Rectangle {
export X := Rectangle {
height: 30%;
// ^error{Cannot find parent property to apply relative length}
Foo {

View file

@ -2,8 +2,8 @@
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
X := PopupWindow {
// ^error{PopupWindow cannot be the top level}
export X := PopupWindow {
// ^error{PopupWindow cannot be the top level}
Rectangle {

View file

@ -1,7 +1,7 @@
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
TestCase := Rectangle {
export TestCase := Rectangle {
animate x {
duration: 1000ms;
}

View file

@ -5,7 +5,7 @@ Comp := Rectangle {
callback pressed;
}
Test := Comp {
export Test := Comp {
property<int> foo;
foo: 100;
property<NonExistent> bar;

View file

@ -5,7 +5,7 @@ Comp := Rectangle {
property<int> prop;
}
Test := Rectangle {
export Test := Rectangle {
Comp {
prop: 45;
}

View file

@ -1,7 +1,7 @@
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
X := Rectangle {
export X := Rectangle {
property<brush> g1: @radial-gradient();
// ^error{Expected 'circle': currently, only @radial-gradient\(circle, ...\) are supported}
property<brush> g2: @radial-gradient(circle at 100%, #333, #333 50%, #eee 75%, #333 75%);

View file

@ -1,7 +1,7 @@
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
X := Rectangle {
export X := Rectangle {
background: {
return 42;
// ^error{Cannot convert float to brush}

View file

@ -47,7 +47,7 @@ Ex2 := Rectangle {
}
Ex3 := Rectangle {
export Ex3 := Rectangle {
i1 := Image {
// ^error{Elements with rotation properties cannot have children elements}
Rectangle {}

View file

@ -1,7 +1,7 @@
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
SuperSimple := Rectangle {
export SuperSimple := Rectangle {
TouchArea {
clicked => { root.x += 1phx; }
}

View file

@ -5,7 +5,7 @@ Base := Rectangle {
callback blah;
}
SubElements := Rectangle {
export SubElements := Rectangle {
callback foobar;
callback foobar;
// ^error{Duplicated callback declaration}

View file

@ -87,7 +87,7 @@ component NewSyntax {
}
component OldInNewSyntax {
export component OldInNewSyntax {
property<bool> checked;
property <int> border;
property <color> color;
@ -130,4 +130,4 @@ component OldInNewSyntax {
text := Text {}
touch := TouchArea {}
}
}

View file

@ -1,7 +1,7 @@
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
TestCase := Rectangle {
export TestCase := Rectangle {
property<bool> checked;
property <int> border;
animate background { }

View file

@ -1,7 +1,7 @@
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
Test := Window {
export Test := Window {
Text {
text: "hel\lo";
// ^error{Cannot parse string literal}

View file

@ -2,7 +2,7 @@
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
SubElements := Rectangle {
export SubElements := Rectangle {
Rectangle {
background: yellow;

View file

@ -2,6 +2,6 @@
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
SuperSimple := Rectangle {
export SuperSimple := Rectangle {
background: green;
}

View file

@ -2,7 +2,7 @@
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
TestCase := Rectangle {
export TestCase := Rectangle {
Path {
commands: "M 350 300 L 550 300 ";
LineTo { x: 10; y: 100; }

View file

@ -30,7 +30,7 @@ global MyType := {
}
SuperSimple := Rectangle {
export SuperSimple := Rectangle {
MyType {
// ^error{Cannot create an instance of a global component}
ccc: "hello";

View file

@ -3,7 +3,7 @@
struct Struct := { def: int, }
SuperSimple := Rectangle {
export SuperSimple := Rectangle {
DoesNotExist {
// ^error{Unknown type DoesNotExist}
}

View file

@ -8,7 +8,7 @@ global Singleton := {
// ^error{A global component cannot have an 'init' callback}
}
Test := Rectangle {
export Test := Rectangle {
callback init;
// ^error{Cannot override callback 'init'}
}

View file

@ -10,7 +10,7 @@ Foo := Rectangle {
}
}
Bar := Rectangle {
export Bar := Rectangle {
Foo { Text {} }
ListView {
Text {}
@ -32,4 +32,4 @@ Bar := Rectangle {
for x in 2: Rectangle {}
// ^warning{A ListView can just have a single 'for' as children. Anything else is not supported}
}
}
}

View file

@ -2,7 +2,7 @@
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
import { TabWidget } from "std-widgets.slint";
Test1 := Rectangle {
export Test1 := Rectangle {
TabWidget {
Rectangle {}
// ^error{Rectangle is not allowed within TabWidget. Only Tab are valid children}

View file

@ -3,7 +3,7 @@
import { TabWidget } from "std-widgets.slint";
Test2 := Rectangle {
export Test2 := Rectangle {
TabWidget {
Tab {
visible: false;

View file

@ -7,5 +7,5 @@ Test3 := Rectangle {
}
}
Foo := TabWidget { }
// ^error{Unknown type TabWidget. \(The type exist as an internal type, but cannot be accessed in this scope\)}
export Foo := TabWidget { }
// ^error{Unknown type TabWidget. \(The type exist as an internal type, but cannot be accessed in this scope\)}

View file

@ -0,0 +1,12 @@
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
component Button {
}
component App {
//^warning{Component is implicitly marked for export. This is deprecated and it should be explicitly exported}
Button {}
}

View file

@ -0,0 +1,7 @@
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
global Settings {
//^warning{Global singleton is implicitly marked for export. This is deprecated and it should be explicitly exported}
in-out property <bool> active;
}

View file

@ -2,7 +2,7 @@
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
X := Rectangle {
export X := Rectangle {
forward-focus: nothingness;
// ^error{Unknown unqualified identifier}
}

View file

@ -2,7 +2,7 @@
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
X := Rectangle {
export X := Rectangle {
edit := TextInput { }
TouchArea {
clicked => {

View file

@ -2,7 +2,7 @@
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
X := Rectangle {
export X := Rectangle {
forward-focus: someRect;
// ^error{element is not focusable}

View file

@ -7,7 +7,7 @@ Abc := Rectangle {
function par() {}
}
Xxx := Rectangle {
export Xxx := Rectangle {
function fooo(a: int, a: int) -> int { return a; }
// ^error{Duplicated argument name 'a'}

View file

@ -10,7 +10,7 @@ Comp := Rectangle {
public function f2() {}
}
Xxx := Rectangle {
export Xxx := Rectangle {
function foo(a: int) -> string { return a; }
comp := Comp {}

View file

@ -138,7 +138,7 @@ Foo_Legacy := Rectangle {
}
Bar_Legacy := Rectangle {
export Bar_Legacy := Rectangle {
pure callback xc1 <=> f.c1;
// ^error{Purity of callbacks 'xc1' and 'f.c1' doesn't match}
callback xc2 <=> f.c2;
@ -149,4 +149,4 @@ Bar_Legacy := Rectangle {
// ^warning{Call of impure callback 'c1'}
}
}
}
}

View file

@ -3,7 +3,7 @@
import { Rec12 } from "../../typeloader/recursive_import1.slint";
// ^error{No exported type called 'Rec12' found in ".*recursive_import1.slint"}
Blah := Rec12 {
// ^error{Unknown type Rec12}
export Blah := Rec12 {
// ^error{Unknown type Rec12}
width: 100px;
}

View file

@ -5,7 +5,7 @@ import { LineEdit } from "sixtyfps_widgets.60";
// ^warning{"sixtyfps_widgets\.60" was renamed "std-widgets\.slint". Use of the old file name is deprecated}
Blah := Window {
export Blah := Window {
LineEdit {} // Not an error
Button {} // Not imported
// ^error{Unknown type Button}

View file

@ -3,7 +3,7 @@
import { X } from "../../typeloader/incpath/should_fail2.slint";
Foo := Rectangle {
export Foo := Rectangle {
x:= X {
hello: 42;
meh: 12;

View file

@ -3,6 +3,6 @@
import { Y } from "../../typeloader/incpath/should_fail3.slint";
Foo := Rectangle {
export Foo := Rectangle {
}

View file

@ -3,7 +3,7 @@
import { Z } from "../../typeloader/incpath/should_fail4.slint";
Foo := Rectangle {
export Foo := Rectangle {
Z {
property <int> b: b1;
}

View file

@ -5,6 +5,6 @@ import { SomeRect } from "../../typeloader/incpath/local_helper_type.slint";
import "../../typeloader/incpath/local_helper_type.slint";
// ^error{Import names are missing. Please specify which types you would like to import}
X := Rectangle {
export X := Rectangle {
}

View file

@ -19,6 +19,6 @@ import "myimage.png";
import ".";
// ^error{Unsupported foreign import ".*"}
X := Rectangle {
export X := Rectangle {
}

View file

@ -5,6 +5,6 @@ import { NotExported } from "../../typeloader/incpath/local_helper_type.slint";
import { } from "../../typeloader/incpath/local_helper_type.slint";
// ^error{Import names are missing. Please specify which types you would like to import}
X := Rectangle {
export X := Rectangle {
}

View file

@ -10,6 +10,6 @@ export { Image as Plop }
export { string as Boob }
// ^error{Cannot export 'string' because it is not a component}
Hello := Plop {
// ^error{Unknown type Plop}
export Hello := Plop {
// ^error{Unknown type Plop}
}

View file

@ -5,7 +5,7 @@ import { SomeRect } from "../../typeloader/incpath/local_helper_type.slint";
import { X } from "../../typeloader/incpath/should_fail.slint";
Blah := X {
export Blah := X {
width: 100px;
// ^error{Unknown property width in X}
}

View file

@ -1,7 +1,7 @@
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
Test := Rectangle {
export Test := Rectangle {
property <bool> condition;
GridLayout {

View file

@ -1,7 +1,7 @@
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
Test := Rectangle {
export Test := Rectangle {
GridLayout {
Rectangle {

View file

@ -1,7 +1,7 @@
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
Hello := Rectangle {
export Hello := Rectangle {
property <int> aa: 45;
property <{o:[int], c:string}> bb;

View file

@ -1,7 +1,7 @@
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
Xxx := Rectangle {
export Xxx := Rectangle {
foo := Rectangle {
callback hello(int) -> int;

View file

@ -1,7 +1,7 @@
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
Xxx := Rectangle {
export Xxx := Rectangle {
foo := Rectangle {
callback hello(int) -> int;

View file

@ -6,7 +6,7 @@ Sub := Rectangle {
callback compute_alias <=> compute;
}
Xxx := Rectangle {
export Xxx := Rectangle {
foo := Rectangle {
callback hello(int) -> int;

View file

@ -1,7 +1,7 @@
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
Xxx := Rectangle {
export Xxx := Rectangle {
callback plop() -> string;
plop => {}
// ^error{Cannot convert void to string}

View file

@ -2,7 +2,7 @@
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
X := Rectangle {
export X := Rectangle {
Rectangle {
background: blue;
}

View file

@ -15,7 +15,7 @@ global Glob := {
property <relative-font-size> rem_allowed: 42rem;
}
X := Rectangle {
export X := Rectangle {
t := Text {
x: "hello";

View file

@ -1,7 +1,7 @@
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
Xxx := Rectangle {
export Xxx := Rectangle {
my-rect := Rectangle {
border-width: 44px;

View file

@ -1,7 +1,7 @@
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
Xxx := Rectangle {
export Xxx := Rectangle {
color: white;
// ^warning{The property 'color' has been deprecated. Please use 'background' instead}

View file

@ -1,7 +1,7 @@
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
TestCase := Text {
export TestCase := Text {
// allow unqualified enum when we can infer the type from the property assigned to
horizontal-alignment: right;

View file

@ -1,7 +1,7 @@
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
Hello := Rectangle {
export Hello := Rectangle {
aaa := Text{ text: "aaa";
bbb := Text{ text: "bbb"; }

View file

@ -16,7 +16,7 @@ global my_lowercase := {
}
X := Rectangle {
export X := Rectangle {
x: MyGlobal.custom_prop;
background: MyGlobal.blue;
// ^error{'MyGlobal' does not have a property 'blue'}

View file

@ -1,7 +1,7 @@
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
Hello := Rectangle {
export Hello := Rectangle {
width: 100phx;
height: 100phx;

View file

@ -15,7 +15,7 @@ Comp := Rectangle {
}
X := Rectangle {
export X := Rectangle {
width: 50phx;
height: width;

Some files were not shown because too many files have changed in this diff Show more