JuliaArrays / AxisArrays.jl

Performant arrays where each dimension can have a named axis with values
http://JuliaArrays.github.io/AxisArrays.jl/latest/
Other
200 stars 41 forks source link

Fix type piracy of 0-arg cat #146

Closed iamed2 closed 5 years ago

iamed2 commented 5 years ago

Fixes #145

The existing definition was causing this:

julia> cat(dims=1)
0-element Array{Any,1}

to become this:

julia> cat(dims=1)
ERROR: BoundsError: attempt to access ()
  at index [1]
Stacktrace:
 [1] getindex(::Tuple{}, ::Int64) at ./tuple.jl:24
 [2] _cat at /Users/ericdavies/.julia/dev/AxisArrays/src/combine.jl:20 [inlined]
 [3] #cat#44(::Int64, ::Function) at /Users/ericdavies/.julia/dev/AxisArrays/src/combine.jl:16
 [4] (::getfield(Base, Symbol("#kw##cat")))(::NamedTuple{(:dims,),Tuple{Int64}}, ::typeof(cat)) at ./none:0
 [5] top-level scope at none:0
mbauman commented 5 years ago

51yl023v6kl _sx425_