Skip to content

Commit

Permalink
Resolve ambiguity
Browse files Browse the repository at this point in the history
  • Loading branch information
BioTurboNick committed Jun 10, 2021
1 parent 1e49c1c commit a499f8d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions base/abstractarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2134,6 +2134,8 @@ julia> hvncat(((3, 3), (3, 3), (6,)), true, a, b, c, d, e, f)
"""
function hvncat end

# if any methods seem redundant here, it is to resolve a multiple dispatch ambiguity

# top-level methods

hvncat(dimsshape::Tuple, row_first::Bool, xs...) = _hvncat(dimsshape, row_first, xs...)
Expand Down Expand Up @@ -2165,6 +2167,8 @@ _typed_hvncat(T::Type, dim::Int, ::Bool, xs...) = _typed_hvncat(T, Val(dim), xs.
_typed_hvncat(::Type{T}, ::Val{0}) where T = Vector{T}()
_typed_hvncat(::Type{T}, ::Val{0}, x) where T = fill(T(x))
_typed_hvncat(::Type{T}, ::Val{0}, x::AbstractArray) where T = T.(x)
_typed_hvncat(::Type, ::Val{0}, ::AbstractArray...) =
throw(ArgumentError("a 0-dimensional array may not have more than one element"))
_typed_hvncat(::Type, ::Val{0}, ::Any...) =
throw(ArgumentError("a 0-dimensional array may not have more than one element"))

Expand Down

0 comments on commit a499f8d

Please sign in to comment.