# What does this error message mean

**URL:** <https://discourse.julialang.org/t/what-does-this-error-message-mean/39303>\
**Category:** General Usage\
**Created:** [May 11, 2020, 7:07pm UTC](https://discourse.julialang.org/t/what-does-this-error-message-mean/39303 "2020-05-11T19:07:15Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![lewis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lewis/32/5217_2.png) [@lewis](https://discourse.julialang.org/u/lewis)\
**Post date:** [May 11, 2020, 7:07pm UTC](https://discourse.julialang.org/t/what-does-this-error-message-mean/39303/1 "2020-05-11T19:07:15Z")

</div>

It should be sort of obvious: I am redefining a `const` somewhere.

Which `const` could it be?

I have nothing named `Variable` anywhere. I only have 4 structs anywhere in the code. None redefine another.

What is the reference to “toplevel”?

```julia
julia> using CovidSim
Revise.LogRecord(Error, evaluation error starting at /Users/lewis/Dropbox/Online Coursework/Covid/src/toplevel:257, lowered, Revise_e943ed8b, "/Users/lewis/.julia/packages/Revise/MgvIv/src/lowered.jl", 106, (mod=JuliaInterpreter, ex=begin
    #= toplevel:257 =#
    struct Variable
        #= /Users/lewis/.julia/packages/JuliaInterpreter/R1LXQ/src/types.jl:269 =#
        value::Any
        #= /Users/lewis/.julia/packages/JuliaInterpreter/R1LXQ/src/types.jl:270 =#
        name::Symbol
        #= /Users/lewis/.julia/packages/JuliaInterpreter/R1LXQ/src/types.jl:271 =#
        isparam::Bool
        #= /Users/lewis/.julia/packages/JuliaInterpreter/R1LXQ/src/types.jl:272 =#
        is_captured_closure::Bool
    end
end)invalid redefinition of constant Variable
Stacktrace:
 [1] top-level scope at none:0)[Info: Precompiling CovidSim [top-level]

```

---

<div class="post-metadata">

**Author:** ![lewis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lewis/32/5217_2.png) [@lewis](https://discourse.julialang.org/u/lewis)\
**Post date:** [May 11, 2020, 7:15pm UTC](https://discourse.julialang.org/t/what-does-this-error-message-mean/39303/2 "2020-05-11T19:15:01Z")

</div>

Never mind. I “up’ed” my packages; quit Julia; restarted Julia in the same terminal session. I’d been in the same terminal session for about a week. That’s just asking for trouble. Memory corruption or Revise got confused. Quit terminal. Open new terminal. Problem gone.

Don’t worry about this. Long sessions are always risky. Pays to purge every day. And it’s good practice to make things clean and repeatable.

---

<div class="post-metadata">

**Author:** ![dpsanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dpsanders/32/3573_2.png) [@dpsanders](https://discourse.julialang.org/u/dpsanders)\
**Post date:** [May 11, 2020, 8:39pm UTC](https://discourse.julialang.org/t/what-does-this-error-message-mean/39303/3 "2020-05-11T20:39:08Z")

</div>

You probably tried to redefine the `struct Variable` with a different definition. This is not possible in Julia and indeed the only solution is to restart the whole Julia process if you wish to redefine it with the same name.

---

<div class="post-metadata">

**Author:** ![lewis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lewis/32/5217_2.png) [@lewis](https://discourse.julialang.org/u/lewis)\
**Post date:** [May 11, 2020, 8:45pm UTC](https://discourse.julialang.org/t/what-does-this-error-message-mean/39303/4 "2020-05-11T20:45:21Z")

</div>

I have nothing named “Variable” anywhere in the module. More likely this came from a package.

---

<div class="post-metadata">

**Author:** ![dpsanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dpsanders/32/3573_2.png) [@dpsanders](https://discourse.julialang.org/u/dpsanders)\
**Post date:** [May 11, 2020, 8:45pm UTC](https://discourse.julialang.org/t/what-does-this-error-message-mean/39303/5 "2020-05-11T20:45:58Z")

</div>

> [@lewis](#):
>
> julia\> using CovidSim Revise.LogRecord(Error, evaluation error starting at /Users/lewis/Dropbox/Online Coursework/Covid/src/toplevel:257, lowered, Revise\_e943ed8b, “/Users/lewis/.julia/packages/Revise/MgvIv/src/lowered.jl”, 106, (mod=JuliaInterpreter, ex=begin #= toplevel:257 =# struct Variable

It’s right there on the 4th line of the code you posted:

```julia
julia> using CovidSim
Revise.LogRecord(Error, evaluation error starting at /Users/lewis/Dropbox/Online Coursework/Covid/src/toplevel:257, lowered, Revise_e943ed8b, "/Users/lewis/.julia/packages/Revise/MgvIv/src/lowered.jl", 106, (mod=JuliaInterpreter, ex=begin
    #= toplevel:257 =#
    struct Variable

```

---

<div class="post-metadata">

**Author:** ![lewis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lewis/32/5217_2.png) [@lewis](https://discourse.julialang.org/u/lewis)\
**Post date:** [May 11, 2020, 8:55pm UTC](https://discourse.julialang.org/t/what-does-this-error-message-mean/39303/6 "2020-05-11T20:55:49Z")

</div>

I can do a text search across all files in the project. No such thing.

What I pasted is the error message. It refers to something that isn’t present. I suspect it was in a package that was subsequently upgraded, which is why it disappeared when I restarted terminal and Julia—with no change to my code.

Let’s let it go. It’s one those mysteries. If it had persisted, then there’d be something to figure out.

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [May 11, 2020, 9:15pm UTC](https://discourse.julialang.org/t/what-does-this-error-message-mean/39303/7 "2020-05-11T21:15:23Z")

</div>

The `struct Variable` is from JuliaInterpreter.jl

> <https://github.com/JuliaDebug/JuliaInterpreter.jl/blob/939c0d7c6a4923459b95fbd83bce403dec40195f/src/types.jl#L268>

and the error you got after updating is because JuliaInterpreter.jl released a new version which included a change to that struct

[https://github.com/JuliaDebug/JuliaInterpreter.jl/pull/388/files#diff-1f61f32925620a8c37482af6f9a5d108R272](https://github.com/JuliaDebug/JuliaInterpreter.jl/pull/388/files#diff-1f61f32925620a8c37482af6f9a5d108R272)

and Revise/Julia can’t handle hot reloading of struct redefinitions.

---

<div class="post-metadata">

**Author:** ![lewis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lewis/32/5217_2.png) [@lewis](https://discourse.julialang.org/u/lewis)\
**Post date:** [May 11, 2020, 9:29pm UTC](https://discourse.julialang.org/t/what-does-this-error-message-mean/39303/8 "2020-05-11T21:29:36Z")

</div>

Perfect. The correct answer.

And reload all was all that had to happen.
