Skip to content

Commit

Permalink
try again for type, fix issue #
Browse files Browse the repository at this point in the history
  • Loading branch information
felixrehren authored Feb 17, 2017
1 parent 60f2c9e commit 21ad84e
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions test/subtype.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

0 comments on commit 21ad84e

Please sign in to comment.