diff --git a/test/subtype.jl b/test/subtype.jl index 528d88c5637a4a..cb9fee0309d7e1 100644 --- a/test/subtype.jl +++ b/test/subtype.jl @@ -928,7 +928,7 @@ CV8625{T<:Real} = Vector{Complex{T}} @test isa([2.0+3.0im],CV8625) # #8915 -mutable struct D8915{T<:Union{Float32,Float64}} +mutable struct D8915{T} where T <: Union{Float32,Float64} D8915(a) = 1 D8915(a::Int) = 2 end @@ -960,15 +960,14 @@ f18892(x) = 1 f18892{T}(x::T) = 2 @test f18892(0) == 2 +# #18985 +f18985{T<:Union{Int32,Int64}}(x::T, y...) = (length(y), f(y[1], y[2:end]...)...) +f18985{T<:Union{Int32,Int64}}(x::T) = (100) +@test f(1,rand(1)...) == (1,100) + # #19041 mutable struct A19041{K} end A19041(K::Type) = A19041{K}() struct B19041{T} end f19041{K}(x::A19041{K}) = deepcopy(x) @test f19041(A19041(B19041)) == A19041{B19041}() - -# #19985 -f19985{T<:Union{Int32,Int64}}(x::T, y...) = (length(y), f(y[1], y[2:end]...)...) -f19985{T<:Union{Int32,Int64}}(x::T) = (100) -@test f(1,rand(1)...) == (1,100) -