From 5cb0f19e17ac24d11bd0152462fdffd61140df16 Mon Sep 17 00:00:00 2001 From: adrhill Date: Mon, 27 Oct 2025 12:59:39 +0100 Subject: [PATCH 1/3] Return `Dual` on `float`, `widen`, `big` --- src/overloads/conversion.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/overloads/conversion.jl b/src/overloads/conversion.jl index deee0655..fd7a8e7f 100644 --- a/src/overloads/conversion.jl +++ b/src/overloads/conversion.jl @@ -52,7 +52,7 @@ end for f in (:big, :widen, :float) @eval Base.$f(::Type{T}) where {T <: AbstractTracer} = T - @eval Base.$f(::Type{D}) where {P, T, D <: Dual{P, T}} = $f(P) # only return primal type + @eval Base.$f(::Type{D}) where {P, T, D <: Dual{P, T}} = Dual{$f(P), T} end ##============================# From 3f869dbc3d1476ae3390d8dc1ac5e14aec90e3fa Mon Sep 17 00:00:00 2001 From: adrhill Date: Mon, 27 Oct 2025 13:31:49 +0100 Subject: [PATCH 2/3] Update reference tests --- test/test_constructors.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_constructors.jl b/test/test_constructors.jl index 274e80cd..5ceca432 100644 --- a/test/test_constructors.jl +++ b/test/test_constructors.jl @@ -48,7 +48,7 @@ end function test_type_conversion_functions(::Type{D}, f::Function) where {P, T, D <: Dual{P, T}} return @testset "Primal type $P_IN" for P_IN in (Int, Float32, Irrational) P_OUT = f(P_IN) - @test f(Dual{P_IN, T}) == P_OUT # NOTE: this tests Dual{P_IN,T}, not Dual{P,T} + @test f(Dual{P_IN, T}) == Dual{P_OUT, T} end end From 2f55a0231b3351cba8391c660565a2c1cf0d729f Mon Sep 17 00:00:00 2001 From: adrhill Date: Mon, 27 Oct 2025 13:45:30 +0100 Subject: [PATCH 3/3] Update CHANGELOG --- CHANGELOG.md | 4 ++++ Project.toml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a547bbea..3e32a27e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # SparseConnectivityTracer.jl +## Version `v1.1.2` +* ![Bugfix][badge-bugfix] Return `Dual` on `float`, `widen`, `big` ([#279]) + ## Version `v1.1.1` * ![Bugfix][badge-bugfix] Fix type conversions of primal value in `Dual` ([#271]) @@ -151,6 +154,7 @@ This release is only breaking for users who touched unexported internals. [badge-maintenance]: https://img.shields.io/badge/maintenance-gray.svg [badge-docs]: https://img.shields.io/badge/docs-orange.svg +[#279]: https://github.com/adrhill/SparseConnectivityTracer.jl/pull/279 [#271]: https://github.com/adrhill/SparseConnectivityTracer.jl/pull/271 [#268]: https://github.com/adrhill/SparseConnectivityTracer.jl/pull/268 [#267]: https://github.com/adrhill/SparseConnectivityTracer.jl/pull/267 diff --git a/Project.toml b/Project.toml index 2237961d..fc23220c 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "SparseConnectivityTracer" uuid = "9f842d2f-2579-4b1d-911e-f412cf18a3f5" authors = ["Adrian Hill "] -version = "1.1.1" +version = "1.1.2-DEV" [deps] ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"