[v2] Unset breaks property setters
Posted: 06 Apr 2023, 10:41
Code: Select all
class Test {
prop {
set => msgbox()
}
}
Test().prop := unset
This is because setters are translated to functions with one required parameter.
Manually defining a setter with an optional parameter fixes this behavior:
Code: Select all
x := {}
x.defineProp("prop", {set: (value?) => msgbox()})
x.prop := unset
(I've tested this on v2.0.2 and v2.0)