RaspberryMatic
RaspberryMatic copied to clipboard
ReGaHss: nested methods calls require parentheses
Describe the bug In certain constellations the ReGa script parser seem to require explicit use of parentheses around single-line nested method calls that should not be required syntax-wise.
Steps to reproduce the behavior The following exmple script should demonstrate the issue:
object src=dom.GetObject(1209);
WriteLine(src.TypeName());
WriteLine(src.Name());
string works=(dom.GetObject(dom.GetObject(src).Channel())).Name();
WriteLine(works);
string breaks=dom.GetObject(dom.GetObject(src).Channel()).Name();
WriteLine(breaks);
WriteLine("DONE");
When adapting this script and using a ISEID of a HSSDP instead of 1209 then a ScriptRuntimeError appears and the following output is created:
HSSDP
BidCos-RF.BidCoS-RF:48.PRESS_LONG
HM-RCV-50 BidCoS-RF:48
Thus, no "DONE" is printed, which is a result of the ScriptRuntimeError.
Expected behavior Analyzing the above script bowls down the issue to the following two calls:
string works=(dom.GetObject(dom.GetObject(src).Channel())).Name();
string breaks=dom.GetObject(dom.GetObject(src).Channel()).Name();
As can be seen the above one seems to work while the second one doesn't work and the only different is missing outer pararentheses which, however, should not be required.
Screenshots n/a
System information:
- RaspberryMatic Version: 3.53.34.202011xx with ReGaHss R1.00.0388.0226
- Used Hardware: OVA on vmWare ESXi
- Used HomeMatic RF-Module: RPI-RF-MOD
Additional context n/a