Skip to content

Commit 1d392b8

Browse files
authored
Use promote_type instead of promote_eltype in misc tests (#164)
1 parent 0079530 commit 1d392b8

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

test/misc.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ end
5656
for eltyb in (Float32, Float64)
5757
a = rand(eltya)
5858
b = rand(eltyb)
59-
T = Base.promote_eltype(eltya, eltyb)
59+
T = Base.promote_type(eltya, eltyb)
6060
@test typeof(logmvbeta(1, a, b)) == T
6161
end
6262
end

test/rmath.jl

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,17 @@ using Test
55
include("utils.jl")
66

77
function check_rmath(fname, statsfun, rmathfun, params, aname, a, isprob, rtol)
8-
v = @inferred(statsfun(params..., a))
9-
rv = @inferred(rmathfun(params..., a))
8+
# [email protected] made some changes that trips inference
9+
# on older versions of Julia. Not worth the the time trying to debug/fix
10+
# as we might drop support for these version soon so just putting the
11+
# inference check behind a VERSION branch
12+
if VERSION >= v"1.7"
13+
v = @inferred(statsfun(params..., a))
14+
rv = @inferred(rmathfun(params..., a))
15+
else
16+
v = statsfun(params..., a)
17+
rv = rmathfun(params..., a)
18+
end
1019
@test v isa float(Base.promote_typeof(params..., a))
1120
@test rv isa float(Base.promote_typeof(params..., a))
1221
if isprob

0 commit comments

Comments
 (0)