Skip to content

Recursive type definition causes "invalid redefinition of constant"  #813

@rasmushenningsson

Description

@rasmushenningsson

If I have the following struct in a module tracked by Revise:

module ReviseBug
struct Foo <: AbstractDict{String,Foo}
    d::Dict{String,Foo}
end
end

it gives the error message invalid redefinition of constant ReviseBug.Foo when revising (even if I don't change the definition of Foo).

On the other hand, this works well:

module ReviseBug
struct Foo
    d::Dict{String,Foo}
end
end

when revising.

I'm using Julia 1.10.2 and Revise v3.5.14.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions