We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2d05141 commit 6a56807Copy full SHA for 6a56807
test/copyable_task.jl
@@ -300,4 +300,31 @@
300
@test Libtask.consume(tt) === 10
301
@test Libtask.consume(tt) === nothing
302
end
303
+
304
+ # Regression test against https://github.com/TuringLang/Libtask.jl/issues/207
305
+ @testset "Union deferencing" begin
306
+ function g(i::Int)
307
+ produce(1)
308
+ return i
309
+ end
310
+ function g(s::String)
311
+ produce(2)
312
+ return s
313
314
+ Libtask.@might_produce g
315
316
+ h(i::Int)::Int = i
317
+ h(s::String)::Int = length(s)
318
319
+ function f(x, g)
320
+ i_or_s = x > 0 ? 3 : "libtask"
321
+ gres = g(i_or_s)
322
+ return h(gres)
323
324
325
+ t = TapedTask(nothing, f, 1, g)
326
+ consume(t)
327
+ # This used to error
328
+ @test (consume(t); true)
329
330
0 commit comments