mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 18:58:36 +00:00
Warn about components that are neither used nor exported
This commit is contained in:
parent
448b216bd8
commit
9180704d70
11 changed files with 62 additions and 25 deletions
|
@ -1,14 +1,14 @@
|
|||
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||
|
||||
NotInIf := Rectangle {
|
||||
export NotInIf := Rectangle {
|
||||
if true: Rectangle {
|
||||
@children
|
||||
// ^error{The @children placeholder cannot appear in a conditional element}
|
||||
}
|
||||
}
|
||||
|
||||
NotInFor := Rectangle {
|
||||
export NotInFor := Rectangle {
|
||||
HorizontalLayout {
|
||||
for xxx in 12: Rectangle {
|
||||
VerticalLayout {
|
||||
|
@ -25,7 +25,7 @@ TestBox := Rectangle {
|
|||
// ^error{The @children placeholder can only appear once in an element}
|
||||
}
|
||||
|
||||
TestBox2 := Rectangle {
|
||||
export TestBox2 := Rectangle {
|
||||
Rectangle {
|
||||
@children
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
background: area.pressed ? green : blue;
|
||||
property<color> c2: area.pressed ? 123 : 456;
|
||||
// ^error{Cannot convert float to color}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||
|
||||
Ex1 := Rectangle {
|
||||
export Ex1 := Rectangle {
|
||||
Rectangle {
|
||||
rotation-origin-x: width / 2;
|
||||
rotation-angle: 45deg;
|
||||
|
@ -25,7 +25,7 @@ ImageWithChild := Image {
|
|||
Rectangle {}
|
||||
}
|
||||
|
||||
Ex2 := Rectangle {
|
||||
export Ex2 := Rectangle {
|
||||
Image {
|
||||
// ^error{Elements with rotation properties cannot have children elements}
|
||||
rotation-angle: 45deg;
|
||||
|
|
|
@ -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;
|
||||
states [
|
||||
|
@ -46,7 +46,7 @@ TestCase := Rectangle {
|
|||
}
|
||||
|
||||
|
||||
component NewSyntax {
|
||||
export component NewSyntax {
|
||||
property<bool> checked;
|
||||
property <int> border;
|
||||
property <color> color;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue