JuliaLang/julia

== for immutables should recursively call == on its fields

Open

#4.648 geöffnet am 26. Okt. 2013

Auf GitHub ansehen
 (60 Kommentare) (44 Reaktionen) (1 zugewiesene Person)Julia (5.773 Forks)batch import
breakingequalityhelp wantedneeds decision

Repository-Metriken

Stars
 (48.709 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 20T 6h) (157 gemergte PRs in 30 T)

Beschreibung

This doesn't make much sense:

julia> immutable Foo{T}
         bar::T
       end

julia> Foo("baz") == Foo("baz")
false

julia> Foo("baz").bar == Foo("baz").bar
true

julia> Foo(1) == Foo(1)
true

If the fields are == to each other then the objects should be == to each other.

Contributor Guide