diagnostic: try to detect use of range expression and recommand to use number

Several users have been asking if it is possible to use range
expression.
Detect this and have a meaningful error message
This commit is contained in:
Olivier Goffart 2025-04-19 22:47:45 +02:00 committed by GitHub
parent 36bc0d1922
commit b77368f1b6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 51 additions and 1 deletions

View file

@ -20,4 +20,8 @@ export SuperSimple := Rectangle {
Rectangle {}
}
for x in 0..32: Rectangle { }
// ^error{Parse error. Range expressions are not supported in Slint. You can use an integer as a model to repeat something multiple time. Eg: `for i in 32 : ...`}
}