Skip to content

Commit 9045899

Browse files
authored
Adjust to method table changes (#304)
* Adjust to method table changes * Bump version
1 parent f894db5 commit 9045899

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "Diffractor"
22
uuid = "9f5e2b26-1114-432f-b630-d3fe2085c51c"
3-
version = "0.2.10"
3+
version = "0.2.11"
44
authors = ["Keno Fischer <[email protected]> and contributors"]
55

66
[deps]

src/analysis/forward.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,4 @@ end
100100

101101
end
102102

103-
const frule_mt = methods(ChainRulesCore.frule).mt
103+
const frule_mt = @static VERSION v"1.13.0-DEV.647" ? nothing : methods(ChainRulesCore.frule).mt

src/stage2/abstractinterpret.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ using .CC: Const, isconstType, argtypes_to_type, tuple_tfunc, Const,
77
using Core: PartialStruct
88
using Base.Meta
99

10+
get_fname(@nospecialize(fT::DataType)) = @static VERSION v"1.13.0-DEV.647" ? fT.name.singletonname : fT.name.mt.name
11+
1012
function CC.abstract_call_gf_by_type(interp::ADInterpreter, @nospecialize(f),
1113
arginfo::ArgInfo, si::StmtInfo, @nospecialize(atype), sv::InferenceState, max_methods::Int)
1214
(;argtypes) = arginfo
@@ -30,7 +32,7 @@ function CC.abstract_call_gf_by_type(interp::ADInterpreter, @nospecialize(f),
3032
if rinterp.current_level == 1
3133
clos = getfield_tfunc(call.info.rrule_rt, Const(2))
3234
else
33-
name = call.info.info.results.matches[1].method.sig.parameters[2].name.mt.name
35+
name = get_fname(call.info.info.results.matches[1].method.sig.parameters[2])
3436
clos = PrimClosure(name, rinterp.current_level - 1, 1, getfield_tfunc(call.info.rrule_rt, Const(2)), call.info, nothing)
3537
end
3638
end

0 commit comments

Comments
 (0)