Skip to content

Commit

Permalink
Use typed_hcat in typed_hvcat (#18398)
Browse files Browse the repository at this point in the history
Fixes 18395
  • Loading branch information
andreasnoack authored Sep 10, 2016
1 parent 600d363 commit fa4c02c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion base/abstractarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1425,7 +1425,7 @@ function typed_hvcat{T}(::Type{T}, rows::Tuple{Vararg{Int}}, as...)
rs = Array{Any,1}(nbr)
a = 1
for i = 1:nbr
rs[i] = hcat(as[a:a-1+rows[i]]...)
rs[i] = typed_hcat(T, as[a:a-1+rows[i]]...)
a += rows[i]
end
T[rs...;]
Expand Down
3 changes: 3 additions & 0 deletions test/abstractarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,9 @@ function test_cat(::Type{TestAbstractArray})
# check for # of columns mismatch b/w rows
@test_throws ArgumentError hvcat((3, 2), 1, 2, 3, 4, 5, 6)
@test_throws ArgumentError Base.typed_hvcat(Int, (3, 2), 1, 2, 3, 4, 5, 6)

# 18395
@test isa(Any["a" 5; 2//3 1.0][2,1], Rational{Int})
end

function test_ind2sub(::Type{TestAbstractArray})
Expand Down

2 comments on commit fa4c02c

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily benchmark build, I will reply here when finished:

@nanosoldier runbenchmarks(ALL, isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @jrevels

Please sign in to comment.