Skip to content

Commit

Permalink
fix JuliaLang#13299, overly pessimistic code for constructing an abst…
Browse files Browse the repository at this point in the history
…ract type
  • Loading branch information
JeffBezanson authored and bjarthur committed Oct 27, 2015
1 parent 68b6f36 commit 72f3477
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions base/inference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ function extract_simple_tparam(Ai)
return Bottom
end

has_typevars(t::ANY) = ccall(:jl_has_typevars, Cint, (Any,), t)!=0
has_typevars(t::ANY, all=false) = ccall(:jl_has_typevars_, Cint, (Any,Cint), t, all)!=0

# TODO: handle e.g. apply_type(T, R::Union{Type{Int32},Type{Float64}})
const apply_type_tfunc = function (A, args...)
Expand Down Expand Up @@ -2283,7 +2283,7 @@ function inlineable(f::ANY, e::Expr, atype::ANY, sv::StaticVarInfo, enclosing_as
if (is(f,apply_type) || is(f,fieldtype) ||
istopfunction(topmod, f, :typejoin) ||
istopfunction(topmod, f, :promote_type)) &&
isleaftype(e.typ.parameters[1])
!has_typevars(e.typ.parameters[1],true)
return (e.typ.parameters[1],())
end
end
Expand Down
2 changes: 1 addition & 1 deletion src/jltypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ static int jl_has_typevars__(jl_value_t *v, int incl_wildcard, jl_value_t **p, s
return 0;
}

static int jl_has_typevars_(jl_value_t *v, int incl_wildcard)
DLLEXPORT int jl_has_typevars_(jl_value_t *v, int incl_wildcard)
{
if (jl_is_typevar(v)) return 1;
return jl_has_typevars__(v, incl_wildcard, NULL, 0);
Expand Down

0 comments on commit 72f3477

Please sign in to comment.