sml icon indicating copy to clipboard operation
sml copied to clipboard

Any state doesn't work correctly with nested sub-states

Open dingari opened this issue 1 year ago • 0 comments

An FSM with a nested sub-state declared as a struct will not correctly transition using the any state feature (#602 )

I've been scratching my head for hours trying to figure out why my state machine doesn't behave the way I expect it to.

See this example.

I expect the state machine to transition from init -> b -> a -> b. This only happens if the nested state machine a itself is declared as a class.

Edit: Seems like it has something to the visibility of operator(). A struct with a private operator() transitions correctly, and a class with a public operator() doesn't...

dingari avatar Jun 21 '24 14:06 dingari