-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Gracefully fail in compiler if dependency cycle exists (#1772)
We currently assume/hope the front-end scenario will catch dependency cycles (the JS, Python, or whatever scenario is feeding the dependencies in) and panic otherwise. Upon retrospection, this was naive, and we should handle dependency cycles gracefully if they're passed through to the back-end. It certainly doesn't hurt, and there are myriad opportunities for the various calling paths from the front-end to invoke the compiler. We shouldn't have to audit each one for dependency cycles. @idavis found a panic which was not detected by the front-end, and therefore caused the backend to panic, and the language service to crash. This PR updates the compiler to report a `DependencyCycle` error, which ultimately shows up in the _Problems_ tab, if one is detected in the backend. After the update, the error shows up like this (instead of panicking): <img width="651" alt="image" src="https://github.com/user-attachments/assets/534e5d0a-edc0-4622-8079-988a3d249c21">
- Loading branch information
Showing
4 changed files
with
56 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters