Skip to content

Commit

Permalink
fix #5536, specificity bug in varargs methods
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Mar 9, 2014
1 parent f1c243a commit 61deebc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/jltypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -1926,8 +1926,15 @@ static int jl_tuple_subtype_(jl_value_t **child, size_t cl,
if (pseq) pe = jl_tparam0(pe);

if (!jl_subtype_le(ce, pe, ta, morespecific, invariant)) {
if (!mode || !type_eqv_(ce, pe))
if (type_eqv_(ce,pe)) {
if (ci==cl-1 && pi==pl-1 && !cseq && pseq) {
return 1;
}
if (!mode) return 0;
}
else {
return 0;
}
}

if (mode && cseq && !pseq)
Expand Down
5 changes: 5 additions & 0 deletions test/core.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1449,3 +1449,8 @@ macro X6074()
end
x6074 = 6074
@test @X6074() == 6074

# issue #5536
test5536(a::Union(Real, AbstractArray)...) = "Splatting"
test5536(a::Union(Real, AbstractArray)) = "Non-splatting"
@test test5536(5) == "Non-splatting"

0 comments on commit 61deebc

Please # to comment.