Skip to content

Commit 2970623

Browse files
committed
Added misc tests referenced in JuliaLang#19998
Added tests for issues JuliaLang#12580, JuliaLang#18348, JuliaLang#13165, JuliaLang#11803, JuliaLang#12721 Enabled tests for JuliaLang#11840
1 parent 8313964 commit 2970623

File tree

2 files changed

+29
-6
lines changed

2 files changed

+29
-6
lines changed

test/core.jl

+3-5
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,13 @@ g11840{T<:Tuple}(sig::Type{T}) = 3
7272

7373
g11840b(::DataType) = 1
7474
g11840b(::Type) = 2
75-
# FIXME: how to compute that the guard entry is still required,
76-
# even though Type{Vector} ∩ DataType = Bottom and this method would set cache_with_orig = true
77-
#g11840b{T<:Tuple}(sig::Type{T}) = 3
75+
g11840b{T<:Tuple}(sig::Type{T}) = 3
7876
@test g11840b(Vector) == 2
7977
@test g11840b(Vector.body) == 1
8078
@test g11840b(Vector) == 2
8179
@test g11840b(Vector.body) == 1
82-
#@test g11840b(Tuple) == 3
83-
#@test g11840b(TT11840) == 3
80+
@test g11840b(Tuple) == 3
81+
@test g11840b(TT11840) == 3
8482

8583
h11840(::DataType) = '1'
8684
h11840(::Type) = '2'

test/inference.jl

+26-1
Original file line numberDiff line numberDiff line change
@@ -493,4 +493,29 @@ abstract AbstractMyType18457{T,F,G}
493493
immutable MyType18457{T,F,G}<:AbstractMyType18457{T,F,G} end
494494
tpara18457{I}(::Type{AbstractMyType18457{I}}) = I
495495
tpara18457{A<:AbstractMyType18457}(::Type{A}) = tpara18457(supertype(A))
496-
@test tpara18457(MyType18457{true}) === true
496+
@test tpara18457(MyType18457{true}) == true
497+
498+
# Issue #12580
499+
abstract AbstractMyType12580{T}
500+
immutable MyType12580{T}<:AbstractMyType12580{T} end
501+
tpara{A<:AbstractMyType12580}(::Type{A}) = tpara(supertype(A))
502+
tpara{I}(::Type{AbstractMyType12580{I}}) = I
503+
@test tpara(MyType12580{true})
504+
505+
# Issue #18348
506+
f18348{T<:Any}(::Type{T}, x) = 1
507+
f18348{T<:Any}(::Type{T}, x::T) = 2
508+
@test length(methods(f18348, Tuple{Type{Any},Any})) == 1
509+
510+
# Issue #13165
511+
@test Symmetric{Float64,Matrix{Float64}} <: LinAlg.RealHermSymComplexHerm
512+
@test Hermitian{Float64,Matrix{Float64}} <: LinAlg.RealHermSymComplexHerm
513+
@test Hermitian{Complex{Float64},Matrix{Complex{Float64}}} <: LinAlg.RealHermSymComplexHerm
514+
515+
# Issue #11803
516+
@test TypeVar(:T, Int) <: Int
517+
@test TypeVar(:T, Union{Int,Float64}) <: Union{Int,Float64}
518+
519+
# Issue #12721
520+
f12721{T<:Type{Int}}(::T) = true;
521+
@test_throws MethodError f12721(Float64)

0 commit comments

Comments
 (0)