Skip to content

Commit aeae29b

Browse files
committed
move similar_type inside quote
1 parent a2b2000 commit aeae29b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/apiutils.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ end
1818
# vector mode function evaluation #
1919
###################################
2020

21-
@generated function dualize(::Type{T}, x::StaticArray) where T
22-
N = _static_length(StaticArraysCore.Size(x))
21+
@generated function dualize(::Type{T}, x::S) where {T, S<:StaticArray}
22+
N = _static_length(StaticArraysCore.Size(S))
2323
dx = Expr(:tuple, [:(Dual{T}(x[$i], chunk, Val{$i}())) for i in 1:N]...)
24-
V = StaticArraysCore.similar_type(x, Dual{T,eltype(x),N})
2524
return quote
25+
V = StaticArraysCore.similar_type(S, Dual{$T, $(eltype(x)), $N})
2626
chunk = Chunk{$N}()
2727
$(Expr(:meta, :inline))
28-
return $V($(dx))
28+
return V($(dx))
2929
end
3030
end
3131

0 commit comments

Comments
 (0)