Skip to content

Commit

Permalink
Fix concatenations with leading types (JuliaLang#27335)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbauman committed Jun 1, 2018
1 parent 4dc4fd0 commit 5583ae4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 3 additions & 3 deletions base/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -323,11 +323,11 @@ end
@deprecate cat_t(::Type{Val{N}}, ::Type{T}, A, B) where {N,T} cat_t(T, A, B, dims=Val(N)) false
@deprecate reshape(A::AbstractArray, ::Type{Val{N}}) where {N} reshape(A, Val(N))

# Issue #
# Issue #27100
@deprecate cat(dims, As...) cat(As..., dims=dims)
@deprecate cat_t(dims, ::Type{T}, As...) where {T} cat_t(T, As...; dims=dims) false
# Disambiguate
cat_t(::Type{T}, ::Type{S}, As...; dims=dims) where {T,S} = _cat_t(T, S, As...; dims=dims)
# Disambiguate — this isn't deprecated but it needs to be supported
cat_t(::Type{T}, ::Type{S}, As...; dims=dims) where {T,S} = _cat_t(dims, T, S, As...)


@deprecate read(s::IO, x::Ref) read!(s, x)
Expand Down
5 changes: 5 additions & 0 deletions test/arrayops.jl
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,11 @@ end
@test A23994[5] isa Float64
@test A23994[6] isa Rational{Int}
end
@testset "cat issue #27326" begin
@test [Int; 1] == [Int, 1]
@test [Int 1] == reshape([Int, 1], 1, :)
@test [Int 1; String 2] == reshape([Int, String, 1, 2], 2, 2)
end
@testset "end" begin
X = [ i+2j for i=1:5, j=1:5 ]
@test X[end,end] == 15
Expand Down

0 comments on commit 5583ae4

Please sign in to comment.