Skip to content

Commit

Permalink
Merge pull request JuliaLang#14823 from JuliaLang/jb/fixthing
Browse files Browse the repository at this point in the history
fix UndefVarError problem
  • Loading branch information
tkelman committed Jan 28, 2016
2 parents 5b1b0c5 + 623f0f3 commit 9f7bcd6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/gf.c
Original file line number Diff line number Diff line change
Expand Up @@ -443,11 +443,13 @@ void jl_type_infer(jl_lambda_info_t *li, jl_tupletype_t *argtypes, jl_lambda_inf
#endif
#ifdef ENABLE_INFERENCE
jl_value_t *newast = jl_apply(jl_typeinf_func, fargs, 4);
jl_value_t *defast = def->ast;
li->ast = jl_fieldref(newast, 0);
jl_gc_wb(li, li->ast);
li->rettype = jl_fieldref(newast, 1);
jl_gc_wb(li, li->rettype);
li->inferred = 1;
// if type inference bails out it returns def->ast
li->inferred = li->ast != defast;
#endif
li->inInference = 0;
}
Expand Down
4 changes: 4 additions & 0 deletions test/linalg/tridiag.jl
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ for elty in (Float32, Float64, Complex64, Complex128, Int)
@test eigvecs(Ts) == eigvecs(Fs)
#call to LAPACK.stein here
Test.test_approx_eq_modphase(eigvecs(Ts,eigvals(Ts)),eigvecs(Fs))
elseif elty != Int
# check that undef is determined accurately even if type inference
# bails out due to the number of try/catch blocks in this code.
@test_throws UndefVarError Fs
end

# Test det(A::Matrix)
Expand Down

0 comments on commit 9f7bcd6

Please sign in to comment.