-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Enable recursion #3018
Comments
I think ideally we'd remove AST inlining altogether before enabling recursion. The issue is we still don't globally name everything in the AST, so it's possible for functions with the same local name to be confused. But yeah, I'm sure we could add some hacks to keep inlined AST but ensure that recursion is still correct, maybe with some simple function tagging to distinguish same named functions. |
@tritao what is the current state of this? |
Recursion seems to work at a codegen-level, but we need to make some changes to the type checker and disable our recursion analysis checks to make this generally applicable. |
ReplaceDecls, CollectTypesMetadata, HashWithEngines now have a mechanism that interrupts recursive visiting. The mechanism works by adding TypeIds or DeclIds to a HashMap or HashSet and no longer visiting TypeIds or DeclIds on the passed collection. This was necessary because in some cases while visiting a declaration we can go back to the beginning because of recursive DeclIds. I suspect these changes will also be useful to #3018 This partially fixes #5504, which is still failing because we have yet to fix a recursion problem in the IR side of the compiler.
ReplaceDecls, CollectTypesMetadata, HashWithEngines now have a mechanism that interrupts recursive visiting. The mechanism works by adding TypeIds or DeclIds to a HashMap or HashSet and no longer visiting TypeIds or DeclIds on the passed collection. This was necessary because in some cases while visiting a declaration we can go back to the beginning because of recursive DeclIds. I suspect these changes will also be useful to #3018 This partially fixes #5504, which is still failing because we have yet to fix a recursion problem in the IR side of the compiler.
ReplaceDecls, CollectTypesMetadata, HashWithEngines now have a mechanism that interrupts recursive visiting. The mechanism works by adding TypeIds or DeclIds to a HashMap or HashSet and no longer visiting TypeIds or DeclIds on the passed collection. This was necessary because in some cases while visiting a declaration we can go back to the beginning because of recursive DeclIds. I suspect these changes will also be useful to #3018 This partially fixes #5504, which is still failing because we have yet to fix a recursion problem in the IR side of the compiler.
Now that function calls have been (mostly) implemented, we can start looking into enabling recursion. There may be a few checks that we should remove and make sure that we're not recursively inlining function bodies in the AST.
The text was updated successfully, but these errors were encountered: