Skip to content

Commit 345dde6

Browse files
committed
fix nightly error by tweaking compilation heuristic
1 parent 4548ec2 commit 345dde6

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

test/interpret.jl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,14 @@ module VecTest
645645
end
646646
f() = 1.0 * one(Tensor{2,3})
647647
end
648-
let a = (VecElement{Float64}(1.0), VecElement{Float64}(2.0))
648+
let
649+
# NOTE we need to make sure this code block is compiled, since vecadd is generated function,
650+
# but currently `@interpret` doesn't handle a call to generated functions very well
651+
@static if isdefined(Base, :Experimental) &&
652+
isdefined(Base.Experimental, Symbol("@force_compile"))
653+
Base.Experimental.@force_compile
654+
end
655+
a = (VecElement{Float64}(1.0), VecElement{Float64}(2.0))
649656
@test @interpret(VecTest.vecadd(a, a)) == VecTest.vecadd(a, a)
650657
end
651658
@test @interpret(VecTest.f()) == [1 0 0; 0 1 0; 0 0 1]

0 commit comments

Comments
 (0)