From 2cab8c06f9414e487daaa9046ddb447b9e4b4dad Mon Sep 17 00:00:00 2001
From: Mauro Werder <mauro_lc@runbox.com>
Date: Tue, 17 Jan 2017 18:09:48 +0100
Subject: [PATCH] Added misc tests referenced in #19998

Added tests for issues #12580, #18348, #13165, #12721

For #11803 it was decidided that no tests are needed.

Enabled extra tests for #11840, however, that isssue is not resolved
yet but needs new tests triggering it.
---
 test/core.jl    | 11 ++++++-----
 test/subtype.jl | 22 ++++++++++++++++++++++
 2 files changed, 28 insertions(+), 5 deletions(-)

diff --git a/test/core.jl b/test/core.jl
index b1328be2f9fa6..ee76350adc613 100644
--- a/test/core.jl
+++ b/test/core.jl
@@ -78,15 +78,16 @@ g11840{T<:Tuple}(sig::Type{T}) = 3
 
 g11840b(::DataType) = 1
 g11840b(::Type) = 2
-# FIXME: how to compute that the guard entry is still required,
-# even though Type{Vector} ∩ DataType = Bottom and this method would set cache_with_orig = true
-#g11840b{T<:Tuple}(sig::Type{T}) = 3
+# FIXME (needs a test): how to compute that the guard entry is still required,
+# even though Type{Vector} ∩ DataType = Bottom and this method would set
+# cache_with_orig = true
+g11840b{T<:Tuple}(sig::Type{T}) = 3
 @test g11840b(Vector) == 2
 @test g11840b(Vector.body) == 1
 @test g11840b(Vector) == 2
 @test g11840b(Vector.body) == 1
-#@test g11840b(Tuple) == 3
-#@test g11840b(TT11840) == 3
+@test g11840b(Tuple) == 3
+@test g11840b(TT11840) == 3
 
 h11840(::DataType) = '1'
 h11840(::Type) = '2'
diff --git a/test/subtype.jl b/test/subtype.jl
index e65cb6ecad771..4e3fd85579ab3 100644
--- a/test/subtype.jl
+++ b/test/subtype.jl
@@ -827,5 +827,27 @@ test_intersection()
 test_properties()
 test_intersection_properties()
 
+
 # issue #20121
 @test NTuple{170,Matrix{Int}} <: (Tuple{Vararg{Union{Array{T,1},Array{T,2},Array{T,3}}}} where T)
+
+# Issue #12580
+abstract AbstractMyType12580{T}
+immutable MyType12580{T}<:AbstractMyType12580{T} end
+tpara{A<:AbstractMyType12580}(::Type{A}) = tpara(supertype(A))
+tpara{I}(::Type{AbstractMyType12580{I}}) = I
+@test tpara(MyType12580{true})
+
+# Issue #18348
+f18348{T<:Any}(::Type{T}, x) = 1
+f18348{T<:Any}(::Type{T}, x::T) = 2
+@test length(methods(f18348, Tuple{Type{Any},Any})) == 1
+
+# Issue #13165
+@test Symmetric{Float64,Matrix{Float64}} <: LinAlg.RealHermSymComplexHerm
+@test Hermitian{Float64,Matrix{Float64}} <: LinAlg.RealHermSymComplexHerm
+@test Hermitian{Complex{Float64},Matrix{Complex{Float64}}} <: LinAlg.RealHermSymComplexHerm
+
+# Issue #12721
+f12721{T<:Type{Int}}(::T) = true
+@test_throws MethodError f12721(Float64)