We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b218964 commit 8fdf7e6Copy full SHA for 8fdf7e6
1 file changed
src/to_vec.jl
@@ -22,11 +22,14 @@ end
22
to_vec(x::Vector{<:Real}) = (x, identity)
23
24
# 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)]...)
+# Note this is moderately evil accessing julia's internals
+if VERSION >= v"1.3"
+ @generated function _force_construct(T, args...)
+ return Expr(:splatnew, :T, :args)
+ end
30
+else
31
32
+ return Expr(:new, :T, Any[:(args[$i]) for i in 1:length(args)]...)
33
end
34
35
0 commit comments