Skip to content

Commit

Permalink
add some comments about the way this works
Browse files Browse the repository at this point in the history
  • Loading branch information
shashi committed May 30, 2024
1 parent 37e54b9 commit 8f22c01
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/rewriters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,11 @@ end
struct Walk{ord, C, F, threaded}
rw::C
thread_cutoff::Int
maketerm::F
maketerm::F # XXX: for the 2.0 deprecation cycle, we actually store a function
# that behaves like `similarterm` here, we use `compatmaker` to wrap
# maketerm-like input to do this, with a warning if similarterm provided
# we need this workaround to deprecate because similarterm takes value
# but maketerm only knows the type.
end

function instrument(x::Walk{ord, C,F,threaded}, f) where {ord,C,F,threaded}
Expand All @@ -180,6 +184,7 @@ end
using .Threads

function compatmaker(similarterm, maketerm)
# XXX: delete this and only use maketerm in a future release.
if similarterm isa Nothing
function (x, f, args, type=_promote_symtype(f, args); metadata)
maketerm(typeof(x), f, args, type, metadata)
Expand Down

0 comments on commit 8f22c01

Please sign in to comment.