Skip to content

Commit

Permalink
Apply type depth limit to :new results
Browse files Browse the repository at this point in the history
Should fix #14009.
  • Loading branch information
carnaval committed Nov 19, 2015
1 parent 4bc24d1 commit d2b4809
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion base/inference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1078,7 +1078,7 @@ function abstract_eval(e::ANY, vtypes, sv::StaticVarInfo)
elseif is(e.head,:new)
t = abstract_eval(e.args[1], vtypes, sv)
if isType(t)
t = t.parameters[1]
t = limit_type_depth(t.parameters[1], 0, true, Any[])
else
t = Any
end
Expand Down
7 changes: 7 additions & 0 deletions test/core.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3499,3 +3499,10 @@ let
finalize(obj)
@test finalized == 1
end

# non-terminating inference, issue #14009
type A14009{T}
end
A14009{T}(a::T) = A14009{T}()
f14009(a) = ? ? f14009(A14009(a)) : a
code_typed(f14009, (Int,))

0 comments on commit d2b4809

Please sign in to comment.