Skip to content

Commit cdebc65

Browse files
committed
add a test for #11015, diagonal dispatch inference error fixed by jb/subtype
fixes #11015
1 parent a2e92fb commit cdebc65

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/inference.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,3 +491,13 @@ tpara18457{I}(::Type{AbstractMyType18457{I}}) = I
491491
tpara18457{A<:AbstractMyType18457}(::Type{A}) = tpara18457(supertype(A))
492492
@test tpara18457(MyType18457{true}) === true
493493

494+
# issue #11015
495+
type AT11015
496+
f::Union{Bool,Function}
497+
end
498+
499+
g11015{S}(::Type{S}, ::S) = Int64(1)
500+
f11015(a::AT11015) = g11015(Base.fieldtype(typeof(a), :f), true)
501+
g11015(::Type{Bool}, ::Bool) = 2.0
502+
@test Int <: Base.return_types(f11015, (AT11015,))[1]
503+
@test f11015(AT11015(true)) === Int64(1)

0 commit comments

Comments
 (0)