Let’s consider a file named test.jl
that includes the following self-referential struct:
mutable struct Node
ID::Int
child::Union{Node, Nothing}
end
Somehow, even if I don’t change the file at all, hitting twice the command include("./test.jl")
in the REPL arises an error: ERROR: LOADError: invalid redefinition of constant Node
. So, on each such an occasion, I have to quit and enter the REPL again, which is time-consuming especially when file-size is larger.
Does anyone know how to efficiently avoid this problem? Or, would you point out if I do something wrong?
I’m using Julia version 1.0.1 on Ubuntu 16.04.