Skip to content

Commit 4472ede

Browse files
committed
More docs
1 parent c28c46e commit 4472ede

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

docs/src/internals.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ Libtask.build_callable
1717
Libtask.LazyCallable
1818
Libtask.DynamicCallable
1919
Libtask.callable_ret_type
20+
Libtask.fresh_copy
2021
```

src/copyable_task.jl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,15 @@ const TypeInfo = Tuple{Vector{Any},Dict{ID,Type}}
423423
_typeof(x)
424424
425425
Central definition of typeof, which is specific to the use-required in this package.
426+
Largely the same as `Base._stable_typeof`, differing only in a handful of
427+
situations, for example:
428+
```jldoctest
429+
julia> Base._stable_typeof((Float64,))
430+
Tuple{DataType}
431+
432+
julia> Libtask._typeof((Float64,))
433+
Tuple{Type{Float64}}
434+
```
426435
"""
427436
_typeof(x) = Base._stable_typeof(x)
428437
_typeof(x::Tuple) = Tuple{map(_typeof, x)...}
@@ -881,6 +890,11 @@ function derive_copyable_task_ir(ir::BBCode)::Tuple{BBCode,Tuple,Vector{Any}}
881890
# At present, we're not able to properly infer the values which might
882891
# potentially be produced by a call-which-might-produce. Consequently, we
883892
# have to assume they can produce anything.
893+
#
894+
# This `Any` only affects the return type of the function being derived
895+
# here. Importantly, it does not affect the type stability of subsequent
896+
# statements in this function. As a result, the impact ought to be
897+
# reasoanbly limited.
884898
push!(possible_produce_types, Any)
885899

886900
# Create a new basic block from the existing statements, since all new

0 commit comments

Comments
 (0)