Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes some issues regarding the state machine diagram for typestates.
Multiple Initial States
Issue #43 mentioned the problem where we were only considering a single initial state, which is incorrect for example when we have overloading constructors that lead to a different initial state. This was fixed.
Hidden Loop Transitions
Issue #44 mentioned the problem where Mermaid only displayed a single self-transition when there were multiple ones, even with different labels. To fix this, all those transitions are merged into one single label.
Conditional Transitions
These were being completely ignored before. Now we add transitions of both then and else branches. In the future we might change this to support conditional transitions, e.g.,
cond ? then : elsewould create transitionscond && thenand!cond && else, to better reflect the source code.