Skip to content

Commit b2d5146

Browse files
authored
copy preserves type (#273)
fixes #214
1 parent 7d711ab commit b2d5146

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/abstractarray.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ reshape(a::Array, s::Size{S}) where {S} = s(a)
121121

122122
@inline vec(a::StaticArray) = reshape(a, Size(prod(Size(typeof(a)))))
123123

124-
@inline copy(a::StaticArray) = similar_type(a)(Tuple(a))
124+
@inline copy(a::StaticArray) = typeof(a)(Tuple(a))
125125

126126
# TODO permutedims?
127127

0 commit comments

Comments
 (0)