-
-
Notifications
You must be signed in to change notification settings - Fork 82
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
Macros are not callable when transported to other state #329
Comments
Macros are already kind of odd in how they work. Because there is no refcounting system or else for instructions (and template source), it's not possible for macros to hold a reference at the moment. The best I can do for now is to prevent the panic and error instead. |
This is even harder to fix now that closures are linked to the original state. When a state is removed, the closures are cleared to avoid circular references. See #359 |
Came up also in this context: #430 |
Also came up here: #463 |
Description
Originally macros could not leak out of the calling template, which is why the implementation could get away with indexing into the instructions of the state. Now however you can export the macros by looking them up on the state after rendering. This means that a macro can be called from a state that does not have the macro's instructions stored.
Reproduction steps
The text was updated successfully, but these errors were encountered: