diff --git a/src/types.jl b/src/types.jl index 683f58d4..6872b2de 100644 --- a/src/types.jl +++ b/src/types.jl @@ -245,6 +245,7 @@ function Base.isequal(a::BasicSymbolic{T}, b::BasicSymbolic{S}) where {T,S} E === exprtype(b) || return false T === S || return false + isequal(metadata(a), metadata(b)) || return false return _isequal(a, b, E)::Bool end function _isequal(a, b, E) diff --git a/test/basics.jl b/test/basics.jl index 1402f9ac..f1504c48 100644 --- a/test/basics.jl +++ b/test/basics.jl @@ -336,6 +336,13 @@ end @test !isequal(a, missing) @test !isequal(missing, b) + + a1 = setmetadata(a, Ctx1, "meta_1") + a2 = setmetadata(a, Ctx1, "meta_1") + a3 = setmetadata(a, Ctx2, "meta_2") + @test !isequal(a, a1) + @test isequal(a1, a2) + @test !isequal(a1, a3) end @testset "subtyping" begin