Skip to content

Commit

Permalink
add a test for #11015, diagonal dispatch inference error fixed by jb/…
Browse files Browse the repository at this point in the history
…subtype

fixes #11015
  • Loading branch information
JeffBezanson committed Jan 24, 2017
1 parent a2e92fb commit cdebc65
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/inference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -491,3 +491,13 @@ tpara18457{I}(::Type{AbstractMyType18457{I}}) = I
tpara18457{A<:AbstractMyType18457}(::Type{A}) = tpara18457(supertype(A))
@test tpara18457(MyType18457{true}) === true

# issue #11015
type AT11015
f::Union{Bool,Function}
end

g11015{S}(::Type{S}, ::S) = Int64(1)
f11015(a::AT11015) = g11015(Base.fieldtype(typeof(a), :f), true)
g11015(::Type{Bool}, ::Bool) = 2.0
@test Int <: Base.return_types(f11015, (AT11015,))[1]
@test f11015(AT11015(true)) === Int64(1)

0 comments on commit cdebc65

Please sign in to comment.