From 6673184698b2234f2ec928753721209e8d729e89 Mon Sep 17 00:00:00 2001 From: Kristoffer Carlsson Date: Fri, 26 May 2017 19:17:20 +0200 Subject: [PATCH] add test for code that used to crash, #17003 --- test/inference.jl | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test/inference.jl b/test/inference.jl index bdcabb2ff7a72..9d2209abd2b46 100644 --- a/test/inference.jl +++ b/test/inference.jl @@ -776,3 +776,22 @@ function break_21369() end end @test_throws ErrorException break_21369() # not TypeError + +# issue #17003 +abstract type AArray_17003{T,N} end +AVector_17003{T} = AArray_17003{T,1} + +struct Nable_17003{T} +end + +struct NArray_17003{T,N} <: AArray_17003{Nable_17003{T},N} +end + +(::Type{NArray_17003}){T,N}(::Array{T,N}) = NArray_17003{T,N}() + +gl_17003 = [1, 2, 3] + +f2_17003(item::AVector_17003) = nothing +f2_17003(::Any) = f2_17003(NArray_17003(gl_17003)) + +@test f2_17003(1) == nothing \ No newline at end of file