Skip to content

Commit 58ea459

Browse files
author
Miha Zgubic
committed
all the backings
1 parent 3be5812 commit 58ea459

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/differentials/composite.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,8 @@ canonicalize(comp::Composite{<:Any, <:AbstractDict}) = comp
182182

183183
# Composites of unspecified primal types
184184
canonicalize(comp::Composite{Any, <:NamedTuple{L}}) where {L} = comp
185-
canonicalize(comp::Composite{Any, <:Tuple{L}}) where {L} = comp
185+
canonicalize(comp::Composite{Any, <:Tuple}) where {L} = comp
186+
canonicalize(comp::Composite{Any, <:AbstractDict}) where {L} = comp
186187

187188
"""
188189
_zeroed_backing(P)

test/differentials/composite.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,13 @@ end
155155
@test_throws ArgumentError canonicalize(CFoo(q=99.0, x=2.5))
156156

157157
@testset "unspecified primal type" begin
158-
c = Composite{Any}(;a=1, b=2)
159-
@test c == canonicalize(c)
158+
c1 = Composite{Any}(;a=1, b=2)
159+
c2 = Composite{Any}(1, 2)
160+
c3 = Composite{Any}(Dict(4 => 3))
161+
162+
@test c1 == canonicalize(c1)
163+
@test c2 == canonicalize(c2)
164+
@test c3 == canonicalize(c3)
160165
end
161166
end
162167

0 commit comments

Comments
 (0)