-
Notifications
You must be signed in to change notification settings - Fork 115
Closed
Description
I have a .jl file where I define struct S that I call from another .jl file with using Revise; includet("path_to_file").
With this definition of S, I get ERROR: invalid redefinition of type S even when I'm in a completely new Julia session.
struct S{N}
x::Array{<:Real, N}
S{N}(x::Array{<:Real, N}) where N = new{N}(x)
S(x::Array{<:Real, N}) where N = S{N}(x) # remove this and the error goes away
endIf I remove the second constructor, the error goes away.
I do not get the error, with or without the second constructor, if I use include instead of includet.
julia> versioninfo()
Julia Version 1.9.0
Commit 8e630552924 (2023-05-07 11:25 UTC)
Platform Info:
OS: macOS (arm64-apple-darwin22.4.0)
CPU: 8 × Apple M1
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-14.0.6 (ORCJIT, apple-m1)
Threads: 1 on 4 virtual cores
Environment:
JULIA_EDITOR = code
JULIA_NUM_THREADS =
another user was able to replicate the error: discourse discussion
Metadata
Metadata
Assignees
Labels
No labels