@@ -8,7 +8,7 @@ import Base: *, +, -, /, \, ^, AbstractArray, AbstractMatrix, AbstractVector, Ar
88 axes, copy, copymutable, copyto!, getindex, getproperty, inv,
99 length, map, oneto, promote_op, require_one_based_indexing, show,
1010 similar, size, transpose, adjoint, copymutable, transpose,
11- adjoint, copymutable, transpose
11+ adjoint, copymutable, transpose, tail
1212
1313import Base. Broadcast: BroadcastStyle, Broadcasted, broadcasted
1414
@@ -115,7 +115,11 @@ function chop(A::AbstractMatrix{T}, tol::Real=zero(real(T))) where T
115115end
116116
117117pad (c:: AbstractVector{T} , ax:: Union{OneTo,OneToInf} ) where T = [c; Zeros {T} (length (ax)- length (c))]
118- pad (c, ax... ) = PaddedArray (c, ax)
118+
119+ _colon2axes (:: Tuple{} , bx:: Tuple{} ) = ()
120+ _colon2axes (ax:: Tuple , bx:: Tuple{Colon, Vararg{Any}} ) = (first (ax), _colon2axes (tail (ax), tail (bx))... )
121+ _colon2axes (ax:: Tuple , bx:: Tuple ) = (first (bx), _colon2axes (tail (ax), tail (bx))... )
122+ pad (c, ax... ) = PaddedArray (c, _colon2axes (axes (c), ax))
119123
120124pad (c:: Transpose , ax, bx) = transpose (pad (parent (c), bx, ax))
121125pad (c:: Adjoint , ax, bx) = adjoint (pad (parent (c), bx, ax))
0 commit comments