Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for AASM compiler #2043

Merged
merged 1 commit into from
Oct 17, 2024
Merged

Conversation

marknuzz
Copy link
Contributor

Motivation

  1. Transition methods (after, guard, on_transition, success) were not found and would result in a failed type check if used.
  2. Events can support arguments when being fired, and those arguments are passed to the PrivateAASMEvent method blocks. If we don't have any params arguments for the block, the default behavior of that block argument is not T.untyped, but rather NilClass, which will cause a type error if we try to reference those arguments. So as a result we need to change the proc signature to show one argument of T.untyped rather than no arguments.

Implementation

Added transition callbacks similar to how the events are added. PrivateAASMTransition class is used as the allowed methods are distinct from the allowed methods in the parent PrivateAASMEvent context.

Tests

Yes

@marknuzz marknuzz requested a review from a team as a code owner October 15, 2024 03:19
@KaanOzkan KaanOzkan added the enhancement New feature or request label Oct 15, 2024
@KaanOzkan
Copy link
Contributor

Can be rebased on main that includes #2046

@marknuzz
Copy link
Contributor Author

Ok I have rebased it

@KaanOzkan KaanOzkan merged commit 6d0bc70 into Shopify:main Oct 17, 2024
15 checks passed
@marknuzz marknuzz deleted the marknuzz/aasm-compiler branch October 17, 2024 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants