diff --git a/CHANGELOG.md b/CHANGELOG.md index cd47bd9..204ce06 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed ### Security +## 0.8.23 + +### Fixed + +- eliminate `Union` in `as(SArray{}, ...)` implementation + ## 0.8.22 ### Fixed diff --git a/Project.toml b/Project.toml index 919a63d..fbaf4d3 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "TransformVariables" uuid = "84d833dd-6860-57f9-a1a7-6da5db126cff" authors = ["Tamas K. Papp "] -version = "0.8.22" +version = "0.8.23" [deps] ArgCheck = "dce04be8-c92d-5529-be00-80e4d2c0e197" diff --git a/src/aggregation.jl b/src/aggregation.jl index f124c29..d42f57a 100644 --- a/src/aggregation.jl +++ b/src/aggregation.jl @@ -207,15 +207,15 @@ function transform_with(flag::LogJacFlag, transformation::StaticArrayTransformat y1, ℓ1, index1 = transform_with(flag, inner_transformation, x, index) D == 1 && return SArray{S}(y1), ℓ1, index1 ℓ = Ref(ℓ1) - index = Ref(index1) + cum_index = Ref(index1) function _f(_) - y, ℓΔ, index′ = transform_with(flag, inner_transformation, x, index[]) - index[] = index′ + y, ℓΔ, index′ = transform_with(flag, inner_transformation, x, cum_index[]) + cum_index[] = index′ ℓ[] += ℓΔ y end yrest = SVector{D-1}(_f(i) for i in 2:D) - SArray{S}(pushfirst(yrest, y1)), ℓ[], index[] + SArray{S}(pushfirst(yrest, y1)), ℓ[], cum_index[] end function inverse_eltype(transformation::Union{ArrayTransformation,StaticArrayTransformation},