mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 10:50:00 +00:00
compiler: Warn user when immediately converting gradient macro to color (#6956)
Fixes #6819
This commit is contained in:
parent
35e094e723
commit
e4b70efe6e
3 changed files with 13 additions and 0 deletions
|
@ -29,4 +29,6 @@ export X := Rectangle {
|
|||
// ^error{Unknown unqualified identifier 'r'}
|
||||
property <brush> g15: @linear-gradient(90deg, brown o, green); // #3241
|
||||
// ^error{Unknown unqualified identifier 'o'}
|
||||
property<color> g16: @linear-gradient(0deg, red, green, blue); // #6819
|
||||
// ^warning{Narrowing conversion from brush to color. This can lead to unexpected behavior because the brush is a gradient}
|
||||
}
|
||||
|
|
|
@ -25,4 +25,7 @@ export X := Rectangle {
|
|||
property<brush> g11: @radial-gradient(circle,);
|
||||
|
||||
property<brush> g12: @radial-gradient(circle);
|
||||
|
||||
property<color> g13: @radial-gradient(circle, red, green, blue); // #6819
|
||||
// ^warning{Narrowing conversion from brush to color. This can lead to unexpected behavior because the brush is a gradient}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue