Fix compiler panic when accessing path.commands in expressions

Fixes #5564
This commit is contained in:
Olivier Goffart 2024-09-10 11:47:00 +02:00
parent f25b180ff7
commit 0c8a9fcefb
6 changed files with 30 additions and 4 deletions

View file

@ -24,13 +24,22 @@ export TestCase := Rectangle {
commands: "M 0 0 M -100 0 A 100 100 0 1 0 100 0 A 100 100 0 1 0 100 0 Z";
}
Path {
p := Path {
width: 640px;
height: 480px;
commands: "M 0 0 M -100 0 A 100 100 0 1 0 0 A 100 100 0 1 0 100 0 Z";
// ^error{Error parsing SVG commands}
}
TouchArea {
clicked => {
p.commands = "M 0 0 M -100 0 A 100 100 0 1 0 100 0 A 100 100 0 1 0 100 0 Z";
// ^error{This special property can only be used to make a binding and cannot be accessed}
}
}
Text { text: p.commands; }
// ^error{This special property can only be used to make a binding and cannot be accessed}
Test2 {}
property <[{commands: string}]> model: [{commands: "M 0 0 L 0 100 A 1 1 0 0 0 100 100 L 100 0 Z"}];