Skip to content

Commit 6f5ca05

Browse files
author
oscarddssmith
committed
1 parent b81255d commit 6f5ca05

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

src/stage1/generated.jl

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,16 @@ ChainRulesCore.backing(::ZeroTangent) = ZeroTangent()
403403
ChainRulesCore.backing(::NoTangent) = NoTangent()
404404

405405
function reload()
406-
Core.eval(Diffractor, quote
406+
407+
if VERSION >= v"1.10.0-DEV.649"
408+
q = quote
409+
function (ff::∂⃖recurse)(args...)
410+
$(Expr(:meta, :generated_only))
411+
$(Expr(:meta, :generated, :perform_optic_transform,))
412+
end
413+
end
414+
else
415+
q = quote
407416
function (ff::∂⃖recurse)(args...)
408417
$(Expr(:meta, :generated_only))
409418
$(Expr(:meta,
@@ -417,6 +426,7 @@ function reload()
417426
QuoteNode(Symbol(@__FILE__)),
418427
true)))
419428
end
420-
end)
429+
end
430+
Core.eval(Diffractor, q)
421431
end
422432
reload()

src/stage1/recurse_fwd.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,13 @@ function perform_fwd_transform(@nospecialize(ff::Type{∂☆recurse{N}}), @nospe
6262
ci′
6363
end
6464

65+
66+
if VERSION >= v"1.10.0-DEV.649"
67+
@eval function (ff::∂☆recurse)(args...)
68+
$(Expr(:meta, :generated_only))
69+
$(Expr(:meta, :generated, :perform_fwd_transform))
70+
end
71+
else
6572
@eval function (ff::∂☆recurse)(args...)
6673
$(Expr(:meta, :generated_only))
6774
$(Expr(:meta,
@@ -75,3 +82,4 @@ end
7582
QuoteNode(Symbol(@__FILE__)),
7683
true)))
7784
end
85+
end

0 commit comments

Comments
 (0)