diff --git a/HISTORY.md b/HISTORY.md index 026c849d..2a51050d 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,3 +1,7 @@ +## 0.13.4 + +Added missing methods for `subsumes(::IndexLens, ::PropertyLens)` and vice versa. + ## 0.13.3 Bumped compatibility for JSON.jl to include v1. diff --git a/Project.toml b/Project.toml index 471a9b3b..d061d430 100644 --- a/Project.toml +++ b/Project.toml @@ -3,7 +3,7 @@ uuid = "7a57a42e-76ec-4ea3-a279-07e840d6d9cf" keywords = ["probablistic programming"] license = "MIT" desc = "Common interfaces for probabilistic programming" -version = "0.13.3" +version = "0.13.4" [deps] AbstractMCMC = "80f14c24-f653-4e6a-9b94-39d6b0f70001" diff --git a/src/varname/subsumes.jl b/src/varname/subsumes.jl index 0af5cb4a..f43a92b4 100644 --- a/src/varname/subsumes.jl +++ b/src/varname/subsumes.jl @@ -103,6 +103,10 @@ subsumes(t::PropertyLens{name}, u::PropertyLens{name}) where {name} = true # Otherwise they represent different properties, and thus are not the same. subsumes(t::PropertyLens, u::PropertyLens) = false +# PropertyLens and IndexLens can't subsume each other +subsumes(::PropertyLens, ::IndexLens) = false +subsumes(::IndexLens, ::PropertyLens) = false + # Indices subsumes if they are subindices, i.e. we just call `_issubindex`. # FIXME: Does not support `DynamicIndexLens`. # FIXME: Does not correctly handle cases such as `subsumes(x, x[:])` diff --git a/test/varname.jl b/test/varname.jl index c4895e79..ebf19b59 100644 --- a/test/varname.jl +++ b/test/varname.jl @@ -126,7 +126,9 @@ end @test @varname(x) ≍ @varname(y) @test @varname(x.a) ≍ @varname(y.a) @test @varname(a.x) ≍ @varname(a.y) + @test @varname(a.x[1]) ≍ @varname(a.x.z) @test @varname(x[1]) ≍ @varname(y[1]) + @test @varname(x[1]) ≍ @varname(x.y) # x ∘ ℓ ⊑ x @test_strict_subsumption x.a x