slint/sixtyfps_compiler/tests/syntax/basic/assign.60
2020-07-24 11:43:23 +02:00

28 lines
622 B
Text

SuperSimple := Rectangle {
TouchArea {
clicked => { root.x = 1px; }
}
TouchArea {
clicked => { x = 1px; }
}
TouchArea {
clicked => { 12 = 1; }
// ^error{Assignement need to be done on a property}
}
TouchArea {
clicked => { x = "string"; }
// ^error{Cannot convert string to length}
}
TouchArea {
clicked => { doesnotexist = 24; }
// ^error{Unknown unqualified identifier 'doesnotexist'}
}
property <string> plop;
TouchArea {
clicked => { plop = "string"; }
}
}