Skip to content

Nested structs fails #96

@cedeerwe

Description

@cedeerwe

Hey, I have stumbled upon the following problem in Julia 1.1, here is a MWE:

julia> using Parameters

julia> @with_kw struct Foo; foo; end
Foo

julia> Foo(foo=2)
Foo
  foo: Int64 2

julia> Foo(foo=Foo(foo=2))
Foo
  foo: Int64 2

julia> Foo(foo=2) == Foo(foo=Foo(foo=2))
true

julia> Foo(2) == Foo(Foo(2))
true

Using standard structs

julia> struct Bar; bar; end

julia> Bar(2) == Bar(Bar(2))
false

Using Base.@kwdef in Julia 1.1

julia> Base.@kwdef struct Baz; baz; end
Baz

julia> Baz(baz=2) == Baz(baz=Baz(baz=2))
false

julia> Baz(2) == Baz(Baz(2))
false

I have no idea why this happens, but it looks like a bug.

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