You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We see that Automaton::<State1<()>>::new() yields us a type State1<()> instead of the correct type Automaton<State1<()>>. If we remove the generic parameters to State1, all is well again.
The text was updated successfully, but these errors were encountered:
On another note, traits (currently) are not implemented inside the module, as the module only serves as a declaration of the typestate.
This limitation is due to the amount of extra code the macro needs to process and the consistency between the declaration and implementation DSL. Outside the module you need to be more verbose about the states, which usually means make use of Automaton<...> returns and others.
If you have any idea on how to merge both please open an issue!
Using generics in any of the states causes the automaton's type to be stripped away. Take the following example:
cargo expand
output:We see that
Automaton::<State1<()>>::new()
yields us a typeState1<()>
instead of the correct typeAutomaton<State1<()>>
. If we remove the generic parameters toState1
, all is well again.The text was updated successfully, but these errors were encountered: