slint/internal/compiler/tests/syntax/elements/timer2.slint
Olivier Goffart bcdc3e1cee Timer: make the interval property mandatory
A default of 0 is not a great default because that's way too often
2024-09-18 09:24:39 +02:00

22 lines
649 B
Text

// Copyright © SixtyFPS GmbH <info@slint.dev>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
export component Abc inherits Timer {
// ^error{A component cannot inherit from Timer}
interval: 50ms;
}
export component Def {
if true: Timer { interval: 32ms; }
// ^error{Timer cannot be directly repeated or conditional}
if false: Abc {}
Timer {
// ^error{Timer must have a binding set for its 'interval' property}
running: false;
}
Timer {}
// ^error{Timer must have a binding set for its 'interval' property}
}