Skip to content

Commit

Permalink
tolerate non-types as Tuple parameters better
Browse files Browse the repository at this point in the history
part of #19998
  • Loading branch information
JeffBezanson committed Feb 21, 2017
1 parent 474d05d commit e8d2d95
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/subtype.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ static int is_leaf_bound(jl_value_t *v)
}
return 1;
}
return 0;
return !jl_is_type(v) && !jl_is_typevar(v);
}

static jl_value_t *widen_Type(jl_value_t *t)
Expand Down
3 changes: 3 additions & 0 deletions test/subtype.jl
Original file line number Diff line number Diff line change
Expand Up @@ -938,3 +938,6 @@ ftwoparams(::TwoParams{<:Real,<:Real}) = 3
# supertype operator
@test !(Int >: Integer)
@test Integer >: Int

# tolerate non-types in Tuples
@test typeintersect(Tuple{0}, Tuple{T} where T) === Tuple{0}

0 comments on commit e8d2d95

Please sign in to comment.