diff --git a/base/some.jl b/base/some.jl index a91c3cd3bb5c1..37a1a50a1d48a 100644 --- a/base/some.jl +++ b/base/some.jl @@ -147,4 +147,5 @@ macro something(args...) end ==(a::Some, b::Some) = a.value == b.value +isequal(a::Some, b::Some) = isequal(a.value, b.value) hash(s::Some, h::UInt) = hash(s.value, hash(Some, h)) diff --git a/test/some.jl b/test/some.jl index 3c3050584061f..4e2c006b404b2 100644 --- a/test/some.jl +++ b/test/some.jl @@ -55,6 +55,12 @@ # Two Somes forward to their wrapped things @test ==(Some([0x1]), Some([1])) +@test ==(Some(1), missing) isa Missing +@test ==(missing, Some(1)) isa Missing +@test isequal(Some([0x1]), Some([1])) +@test !isequal(Some(missing), Some([1])) +@test !isequal(Some(1), Some(missing)) +@test isequal(Some(missing), Some(missing)) # hashing implications @test hash(Some(0x1)) != hash(0x1)