Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 4 additions & 0 deletions src/varname/subsumes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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[:])`
Expand Down
2 changes: 2 additions & 0 deletions test/varname.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading