Defining types in a module and then reloading the module helps. The
bindings get messy though, so it's best to qualify all accesses when you're
developing like that. This is kind of an annoyance – not sure how hard it
would be to fix but it should be doable.

On Thu, Feb 11, 2016 at 12:10 PM, Kristoffer Carlsson <[email protected]
> wrote:

> I have a file that defines a type and a few functions. Sometimes I want to
> reload this file in the REPL to update some modified functions in the file.
> If the type is parameterized then this will fail even though the type
> definition does not change.
>
> Example:
>
>
> julia> type Foo
>        a::Int
>        end
>
> julia> type Foo
>        a::Int
>        end
>
> julia> type Foo2{T}
>        a::T
>        end
>
> julia> type Foo2{T}
>        a::T
>        end
> ERROR: invalid redefinition of constant Foo2
>
>
> Is there a good way to work around this? I don't really want to
> workspace() all the time because then I have to compile everything again.
>

Reply via email to