Revise: MethodError JuliaInterpreter.ExprSplitter

I activate a project and work on it, using Revise. I save an edit in emacs and return to the REPL, and enter 1 and Return, and wait for Revise.

Frequently, I get this error:

 Error: Failed to revise /path/to/edited/file.jl
│   exception =
│    MethodError: no method matching JuliaInterpreter.ExprSplitter(::Module, ::Symbol)
│    The type `JuliaInterpreter.ExprSplitter` exists, but no method is defined for this combination of argument types when trying to construct it.

This started happening a few weeks ago. I can’t predict how and when it happens. Searching online, I find no mention of a problem like this. Searching this forum, I find nothing as well.

Data:

  • linux
  • emacs
  • Juia v 1.11 and 1.12
  • Revise v3.8.1, v3.7.3, possibly others
  • Startup packages: Happens sometimes with no packages except what I am developing.

I can’t predict when it will happen. It somtimes happens on every edit. i.e. I can start Julia, load Revise and the package, do one edit, and I get the error. Exit julia, repeat. Do one edit and I get the error.

The method that does exist takes an Expr, but the function is evidently called with a Symbol in that place. Quoting code can produce an Expr, but also a Symbol (and other stuff). It’s probably something like this. Or an Expr is being traversed and this function is somehow called without checking that an elment is in fact an Expr.

The stack trace does not really show a stack trace for the problem. I could try to find a way to actually display the stack of calls.

I suspect that my code is modifying the behavior of things in Base and Revise. This has happened with a couple of different packages.

It seems to be occurring only with specific files in a package. I suspect it is related to parsing. There may be some way to split the file up to look for a MWE.

I’m really surprised that I have not seen others raise this issue.