Skip to content

programmatic uses of doImport forgot to clear lookup caches afterwards. Fixes #2694#2695

Merged
DavyLandman merged 1 commit intomainfrom
fix/issue-2694
Mar 8, 2026
Merged

programmatic uses of doImport forgot to clear lookup caches afterwards. Fixes #2694#2695
DavyLandman merged 1 commit intomainfrom
fix/issue-2694

Conversation

@jurgenvinju
Copy link
Member

@jurgenvinju jurgenvinju commented Mar 8, 2026

This fixes #2694 which was caused by a cached version of the conditional constructor which was created while loading an incomplete module lang::rascal::grammar::definition::Symbols.

  • while loading constructors are searched in the current environment for computing the type of matching patterns
  • these lookups end up being cached
  • but later new overloaded alternatives are being added
  • then normally after and import command on the REPL, all the caches are cleared and the new overloads are found.
  • but when a main module with a main function is run automatically from the mvn command or a normal java -jar, then doImport is called from the commandline parser code and this top-level function did not clear the intermediate caches.

This fixes this urgent issue by calling heap.clearLookupChaches(); when doImport is done.

Warning It is unknown if other issues arise from the cache being active while evaluating incomplete modules. At least this categorically fixes any issue caused by the caches after the imports have finished.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 8, 2026

@codecov
Copy link

codecov bot commented Mar 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 46%. Comparing base (92292b4) to head (50e5691).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##              main   #2695   +/-   ##
=======================================
- Coverage       46%     46%   -1%     
+ Complexity    6680    6678    -2     
=======================================
  Files          795     795           
  Lines        65904   65905    +1     
  Branches      9881    9881           
=======================================
- Hits         30711   30710    -1     
- Misses       32806   32812    +6     
+ Partials      2387    2383    -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@DavyLandman DavyLandman merged commit cf14093 into main Mar 8, 2026
17 of 19 checks passed
@jurgenvinju jurgenvinju deleted the fix/issue-2694 branch March 9, 2026 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

storeParserForModule fails with a trivial module

2 participants