Skip to content

Commit ec1d89d

Browse files
committed
Document callable_ret_type
1 parent 89b0e90 commit ec1d89d

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/copyable_task.jl

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,20 @@ See also: [`Libtask.consume`](@ref)
4343
return x
4444
end
4545

46-
function callable_ret_type(sig, types)
46+
"""
47+
callable_ret_type(sig, produce_types)
48+
49+
Computes the types which might possibly be returned from a `TapedTask`, where `sig` is the
50+
signature (something of the form `Tuple{...}`) of the function from which the `TapedTask` is
51+
constructed, and `produce_types` are the possible types which such a call might `produce`.
52+
53+
In general, computing `produce_types` requires analysing the `produce` type of any statment
54+
in the IR associated to `sig` which might `produce`. See locations where this function is
55+
called to see where this happens.
56+
"""
57+
function callable_ret_type(sig, produce_types)
4758
produce_type = Union{}
48-
for t in types
59+
for t in produce_types
4960
p = isconcretetype(t) ? ProducedValue{t} : ProducedValue{T} where {T<:t}
5061
produce_type = CC.tmerge(p, produce_type)
5162
end

0 commit comments

Comments
 (0)