- 
                Notifications
    You must be signed in to change notification settings 
- Fork 81
better extend cycle detection #2392
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
base: main
Are you sure you want to change the base?
Conversation
| Codecov Report❌ Patch coverage is  Additional details and impacted files@@           Coverage Diff            @@
##              main   #2392    +/-   ##
========================================
- Coverage       47%     47%    -1%     
- Complexity    6571    6578     +7     
========================================
  Files          782     783     +1     
  Lines        64531   64634   +103     
  Branches      9656    9672    +16     
========================================
+ Hits         30548   30562    +14     
- Misses       31620   31697    +77     
- Partials      2363    2375    +12     ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
 | 
…modules at the top-level imports in the REPL
… that lead to the cycle and nothing extra. Also drops the prefix that finds the cycle from the root if present.
…igher up in the import/extend stack
| The next challenge is extending modules which haven't fully loaded yet. This may happen in complex but correct configurations where a given module's imports and extends eventually trigger an extend of itself. The recursive module loader does not currently recognize this situation and extends only what is currently registered in the module. This then leads to errors of the "undeclared x" kind. | 
…ses; only for debugging purposes
…rlying bug: extending modules which are not yet fully loaded because they are on the depth-first search stack of a (cyclic) import/extend graph
…ey lead to partial extend implementations. This does not detect all cycles, only the problematic ones
…-extend-cycle-detection
We detected several serious issues with extend cycle detection in the interpreter:
The current PR should fix these in one go. This is the idea:
which informs the reloading algorithm and improves its correctness
such that the user can not directly access any half-loaded modules.
extend is not fully implemented and function overloads, global variables and data type definitions
may be incomplete.
The above rationalizes the cycle detector and improves the correctness of reloading without touching
the reloading code.
As a side-effect, all other errors detected in modules (static errors and such) will also change a bit:
in the dependency graph, leading to strange effects of the reloader
fixes the error, everything will be in order again.
This PR's implementation is finicky and W.I.P.