Skip to content

Commit 8fdf7e6

Browse files
author
Miha Zgubic
committed
put version on the outside
1 parent b218964 commit 8fdf7e6

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

src/to_vec.jl

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,14 @@ end
2222
to_vec(x::Vector{<:Real}) = (x, identity)
2323

2424
# get around the constructors and make the type directly
25-
@generated function _force_construct(T, args...)
26-
return if VERSION >= v"1.3"
27-
Expr(:splatnew, :T, :args)
28-
else
29-
Expr(:new, :T, Any[:(args[$i]) for i in 1:length(args)]...)
25+
# Note this is moderately evil accessing julia's internals
26+
if VERSION >= v"1.3"
27+
@generated function _force_construct(T, args...)
28+
return Expr(:splatnew, :T, :args)
29+
end
30+
else
31+
@generated function _force_construct(T, args...)
32+
return Expr(:new, :T, Any[:(args[$i]) for i in 1:length(args)]...)
3033
end
3134
end
3235

0 commit comments

Comments
 (0)