I know splitting consts with other parameters is ugly and I just ran into this error by accident.
At least if we're following the classic patterns and structures.
(this is an 1:1 adaption of the declarative CQRS, Redux (js) implementation of an action)
this for example is another way to structure code more contextualized.
I know we could just extract this to a flyweight pattern but that's not the point.
The point is, it's an undefined behaviour and just getting "syntax error" is not enough feedback, since it's syntactically correct at least you don't write any specifics in your documentation https://docs.zephir-lang.com/en/latest/oop.html
the parser throws an syntax error if const are not declared in an consecutive block
this works.
I know splitting consts with other parameters is ugly and I just ran into this error by accident. At least if we're following the classic patterns and structures.
(this is an 1:1 adaption of the declarative CQRS, Redux (js) implementation of an action)
this for example is another way to structure code more contextualized. I know we could just extract this to a flyweight pattern but that's not the point.
The point is, it's an undefined behaviour and just getting "syntax error" is not enough feedback, since it's syntactically correct at least you don't write any specifics in your documentation https://docs.zephir-lang.com/en/latest/oop.html