Skip to content

Commit 1ba2dfe

Browse files
committed
Fix inference bug
1 parent 065fb19 commit 1ba2dfe

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/copyable_task.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ See also: [`Libtask.consume`](@ref)
2222
"""
2323
@noinline function produce(x)
2424
global __v = 4 # silly side-effect to prevent this call getting constant-folded away. Should really use the effects system.
25-
return ProducedValue(x)
25+
return x
2626
end
2727

2828
function callable_ret_type(sig)

src/test_utils.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ end
1515
function (case::Testcase)()
1616
testset = @testset "$(case.name)" begin
1717

18+
# Display some information.
19+
@info "$(case.name)"
20+
1821
# Construct the task.
1922
if case.kwargs === nothing
2023
t = TapedTask(case.dynamic_scope, case.fargs...)
@@ -132,6 +135,9 @@ function test_cases()
132135
Testcase("kwargs tester 2", nothing, (kwarg_tester, 4.0), (; y=5.0), []),
133136
Testcase("default kwarg tester", nothing, (default_kwarg_tester, 4.0), nothing, []),
134137
Testcase("default kwarg tester", nothing, (default_kwarg_tester, 4.0), (;), []),
138+
Testcase(
139+
"final statment produce", nothing, (final_statement_produce,), nothing, [1, 2]
140+
),
135141
]
136142
end
137143

@@ -270,4 +276,9 @@ kwarg_tester(x; y) = x + y
270276

271277
default_kwarg_tester(x; y=5.0) = x * y
272278

279+
function final_statement_produce()
280+
produce(1)
281+
return produce(2)
282+
end
283+
273284
end

0 commit comments

Comments
 (0)