Closed
Description
MWE:
julia> function g()
if randn() > 0
x = 2
else
x = 0.1
end
produce(x)
end
g (generic function with 1 method)
julia> show(Libtask.consume(Libtask.TapedTask(nothing, g)))
nothing
The fact that the type of x
depends on runtime values seems to be significant. The following variants work as expected:
julia> function g()
if randn() > 0
x = 0.2
else
x = 0.1
end
produce(x)
end
g (generic function with 1 method)
julia> show(Libtask.consume(Libtask.TapedTask(nothing, g)))
0.2
and
julia> function g()
if randn() isa Float64
x = 1
else
x = 0.1
end
produce(x)
end
g (generic function with 1 method)
julia> show(Libtask.consume(Libtask.TapedTask(nothing, g)))
1
Metadata
Metadata
Assignees
Labels
No labels