Fix #6: world age error when displaying values from newly loaded packages #8

Merged
kahliburke merged 12 commits from fix/6-world-age-display-v2 into main 2026-03-07 10:34:09 -08:00
kahliburke commented 2026-03-07 00:20:02 -08:00 (Migrated from github.com)

Summary

  • Wraps show, repr, and showerror calls in Base.invokelatest within _eval_with_capture
  • When Core.eval(Main, expr) loads a package (e.g. using Symbolics), new methods are defined in a newer world age than the REPL backend thread context. Without invokelatest, display calls fail with "method too new to be called from this world context", the exception escapes with package-specific type references, cross-process deserialization fails, and raw binary bytes leak into output.

Fixes #6

## Summary - Wraps `show`, `repr`, and `showerror` calls in `Base.invokelatest` within `_eval_with_capture` - When `Core.eval(Main, expr)` loads a package (e.g. `using Symbolics`), new methods are defined in a newer world age than the REPL backend thread context. Without `invokelatest`, display calls fail with "method too new to be called from this world context", the exception escapes with package-specific type references, cross-process deserialization fails, and raw binary bytes leak into output. Fixes #6
Sign in to join this conversation.
No description provided.