Binding between a read only property to input-output is deprecated (#6419)

ChangeLog: deprecated two way binding between `in` and `in-out` property

Fixes #6400
This commit is contained in:
Olivier Goffart 2024-10-01 16:00:06 +02:00 committed by GitHub
parent 40811193aa
commit d6706494a5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 46 additions and 16 deletions

View file

@ -85,6 +85,7 @@ export component C3 {
// checked is "input/output" in Button
out <=> b.checked;
in <=> b.checked;
// ^warning{Linking input properties to input output properties is deprecated}
inout <=> b.checked;
priv <=> b.checked;
@ -293,6 +294,28 @@ export component C11 {
}
}
export component C12 {
in property <bool> in1 <=> btn.pressed;
// ^error{Cannot link to a output property}
in property <bool> in2 <=> btn.checked;
// ^warning{Linking input properties to input output properties is deprecated}
in property <bool> in3 <=> btn.enabled;
in property <bool> in4 <=> btn.accessible-checked;
in property <bool> in5 <=> inout1;
// ^error{Cannot link input property}
in-out property <bool> inout1;
btn := Button {
clicked => {
self.checked = !self.checked;
// ^error{Cannot modify a property that is linked to a read-only property}
self.enabled = !self.enabled;
// ^error{Cannot modify a property that is linked to a read-only property}
}
}
}
export Legacy1 := Rectangle {
b1:= Button {}
in property in1 <=> b1.pressed;