-
Notifications
You must be signed in to change notification settings - Fork 125
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
SystemStackError for has_many assocation that points to own model #1883
Comments
I wasn't able to reproduce. If you can share a small app that has the same problem I can take a look. |
Ah my bad it turns out that there's more to it than what I thought, the traceback doesn't really point to the source of the error. I've uploaded a demo here: https://github.com/jackwurth/sorbet_bug_demo The test setup is: Running it seems the cause is more likely to be to do with the |
We are triggering the recursive calls here which eventually attempts to call There might be a better way to do this but I think we can filter out this case by checking if |
@paracycle do you have context on the internals? We enter infinite recursion while validating a has_many through association that points to the same model https://github.com/jackwurth/sorbet_bug_demo/blob/main/app/models/group.rb#L8. I was thinking if we can reliably detect this by looking at the reflection name (above comment) we could skip validating and return |
I have a setup involving a model with a has_many that points to itself
each record has a
parent_id
to point to it's parent group.This setup works fine with rails, but tapioca crashes when it tries to generate it with a SystemStackError
Tested with Tapioca version 0.13.3
The text was updated successfully, but these errors were encountered: