@@ -486,7 +486,7 @@ function toexpr(a::MakeArray, st)
486486end
487487
488488# # Array
489- @inline function _create_array (:: Type{<:Array } , T, :: Val{dims} , elems... ) where dims
489+ @inline function _create_array (:: Type{<:AbstractArray } , T, :: Val{dims} , elems... ) where dims
490490 arr = Array {T} (undef, dims)
491491 @assert prod (dims) == nfields (elems)
492492 @inbounds for i= 1 : prod (dims)
@@ -495,35 +495,45 @@ end
495495 arr
496496end
497497
498- @inline function create_array (A:: Type{<:Array } , T, :: Val , d:: Val , elems... )
498+ @inline function create_array (A:: Type{<:AbstractArray } , T, :: Val , d:: Val , elems... )
499499 _create_array (A, T, d, elems... )
500500end
501501
502- @inline function create_array (A:: Type{<:Array } , :: Nothing , :: Val , d:: Val{dims} , elems... ) where dims
502+ @inline function create_array (A:: Type{<:AbstractArray } , :: Nothing , :: Val , d:: Val{dims} , elems... ) where dims
503503 T = promote_type (map (typeof, elems)... )
504504 _create_array (A, T, d, elems... )
505505end
506506
507507# # Vector
508508#
509- @inline function create_array (:: Type{<:Array } , :: Nothing , :: Val{1} , :: Val{dims} , elems... ) where dims
509+ @inline function create_array (:: Type{<:AbstractArray } , :: Nothing , :: Val{1} , :: Val{dims} , elems... ) where dims
510510 [elems... ]
511511end
512512
513- @inline function create_array (:: Type{<:Array } , T, :: Val{1} , :: Val{dims} , elems... ) where dims
513+ @inline function create_array (:: Type{<:AbstractArray } , T, :: Val{1} , :: Val{dims} , elems... ) where dims
514514 T[elems... ]
515515end
516516
517517# # Matrix
518518
519- @inline function create_array (:: Type{<:Array } , :: Nothing , :: Val{2} , :: Val{dims} , elems... ) where dims
519+ @inline function create_array (:: Type{<:AbstractArray } , :: Nothing , :: Val{2} , :: Val{dims} , elems... ) where dims
520520 vhcat (dims, elems... )
521521end
522522
523- @inline function create_array (:: Type{<:Array } , T, :: Val{2} , :: Val{dims} , elems... ) where dims
523+ @inline function create_array (:: Type{<:AbstractArray } , T, :: Val{2} , :: Val{dims} , elems... ) where dims
524524 typed_vhcat (T, dims, elems... )
525525end
526526
527+ @inline function create_array (:: Type{<:Base.ReinterpretArray} , :: Nothing ,
528+ :: Val{1} , :: Val{dims} , elems... ) where {dims}
529+ [elems... ]
530+ end
531+
532+ @inline function create_array (
533+ :: Type{<:Base.ReinterpretArray} , T, :: Val{1} , :: Val{dims} , elems... ) where {dims}
534+ T[elems... ]
535+ end
536+
527537
528538vhcat (sz:: Tuple{Int,Int} , xs:: T... ) where {T} = typed_vhcat (T, sz, xs... )
529539vhcat (sz:: Tuple{Int,Int} , xs:: Number... ) = typed_vhcat (Base. promote_typeof (xs... ), sz, xs... )
0 commit comments