Skip to content

Commit

Permalink
Only check inference on more recent versions of Julia
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasnoack committed Feb 14, 2024
1 parent 0a1e13d commit 5919b62
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions test/rmath.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,17 @@ using Test
include("utils.jl")

function check_rmath(fname, statsfun, rmathfun, params, aname, a, isprob, rtol)
v = @inferred(statsfun(params..., a))
rv = @inferred(rmathfun(params..., a))
# [email protected] made some changes that trips inference
# on older versions of Julia. Not worth the the time trying to debug/fix
# as we might drop support for these version soon so just putting the
# inference check behind a VERSION branch
if VERSION >= v"1.7"
v = @inferred(statsfun(params..., a))
rv = @inferred(rmathfun(params..., a))
else
v = statsfun(params..., a)
rv = rmathfun(params..., a)
end
@test v isa float(Base.promote_typeof(params..., a))
@test rv isa float(Base.promote_typeof(params..., a))
if isprob
Expand Down

0 comments on commit 5919b62

Please sign in to comment.