diff --git a/test/subtype.jl b/test/subtype.jl index 27b33350782a04..82c622513749ab 100644 --- a/test/subtype.jl +++ b/test/subtype.jl @@ -915,3 +915,27 @@ ftwoparams(::TwoParams{<:Real,<:Real}) = 3 # supertype operator @test !(Int >: Integer) @test Integer >: Int + +# #2552 +typealias DiagDict{T} Dict{T,T} +f2552(::Dict) = 1 +f2552(::DiagDict) = 2 +@test f2552(Dict(1 => "a")) == 1 +@test f2552(Dict(1 => 1)) == 2 + +# #8625 +typealias CV8625{T<:Real} Vector{Complex{T}} +@test isa([2.0+3.0im],CV8625) + +# #8915 +type D8915{T <: Union{Float32,Float64}} + D8915(a) = 1 + D8915(a::Int) = 2 +end +@test D8915{Float64}(1) = 2 + +# #11407 +f11407{K,V}(::Dict{K,V},::Dict{Any,V}) = 1 +f11407{K,V}(::Dict{K,V},::Dict{K,Any}) = 2 +d = Dict{Any,Any}() +@test_throws MethodError f11407(d,d)