Skip to content

Commit fa46076

Browse files
committed
fix setproperties(obj, ::NTuple{N,Any})
1 parent 12234d4 commit fa46076

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/ConstructionBase.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ setproperties_object(obj, patch::Tuple{}) = obj
154154
obj = $obj
155155
patch = $patch
156156
"""
157+
throw(ArgumentError(msg))
157158
end
158159
setproperties_object(obj, patch::NamedTuple{()}) = obj
159160
function setproperties_object(obj, patch)

test/runtests.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ end
4545
@test setproperties((a=1,), ()) === (a=1,)
4646
@test setproperties((a=1,), NamedTuple()) === (a=1,)
4747
@test setproperties(AB(1,2), ()) === AB(1,2)
48+
@test_throws ArgumentError setproperties(AB(1,2), (10,))
4849
@test setproperties(AB(1,2), NamedTuple()) === AB(1,2)
4950

5051
@test setproperties(AB(1,2), (a=2, b=3)) === AB(2,3)

0 commit comments

Comments
 (0)