@@ -29,11 +29,7 @@ function reflect(@nospecialize(sigtypes::Tuple), world::UInt)
29
29
end
30
30
method_index === 0 && return nothing
31
31
type_signature, raw_static_params, method = _methods[method_index]
32
- if VERSION < v " 1.8-"
33
- method_instance = Core. Compiler. specialize_method (method, type_signature, raw_static_params, false )
34
- else
35
- method_instance = Core. Compiler. specialize_method (method, type_signature, raw_static_params; preexisting= false )
36
- end
32
+ method_instance = Core. Compiler. specialize_method (method, type_signature, raw_static_params; preexisting= false )
37
33
method_signature = method. sig
38
34
static_params = Any[raw_static_params... ]
39
35
return method_instance, method_signature, static_params
@@ -47,11 +43,7 @@ function _generate_literal_getproperty(ctx, world, x, ::Type{Val{f}}) where f
47
43
sig (x) = Tuple{x, typeof (f)}
48
44
rrule_sig (x) = Tuple{typeof (getproperty), x, typeof (f)}
49
45
pb_sig (x) = Tuple{ctx, typeof (getproperty), x, typeof (f)}
50
- @static if VERSION >= v " 1.10.0-DEV.65"
51
- which (f, t) = Base. _which (Base. signature_type (f, t); world). method
52
- else
53
- which (f, t) = Base. which (f, t)
54
- end
46
+ which (f, t) = Base. _which (Base. signature_type (f, t); world). method
55
47
56
48
# either `getproperty` has a custom implementation or `_pullback(ctx, getproperty, x, f)`
57
49
# / `rrule(getproperty, x, f) is overloaded directly
@@ -62,11 +54,7 @@ function _generate_literal_getproperty(ctx, world, x, ::Type{Val{f}}) where f
62
54
if is_getfield_fallback
63
55
# just copy pullback of `literal_getfield`
64
56
mi, _sig, sparams = reflect ((typeof (_pullback), ctx, typeof (literal_getfield), x, Val{f}), world)
65
- ci = if VERSION >= v " 1.10.0-DEV.873"
66
- copy (Core. Compiler. retrieve_code_info (mi, world))
67
- else
68
- copy (Core. Compiler. retrieve_code_info (mi))
69
- end
57
+ ci = copy (Core. Compiler. retrieve_code_info (mi, world))
70
58
71
59
# we need to change the second arg to `_pullback` from `literal_getproperty` to
72
60
# `literal_getfield`
@@ -100,7 +88,6 @@ function _generate_literal_getproperty(ctx, world, x, ::Type{Val{f}}) where f
100
88
end
101
89
end
102
90
103
- if VERSION >= v " 1.10.0-DEV.873"
104
91
105
92
# on Julia 1.10, generated functions need to keep track of the world age
106
93
116
103
$ (Expr (:meta , :generated , _literal_getproperty_pullback_generator))
117
104
$ (Expr (:meta , :generated_only ))
118
105
end
119
-
120
- else
121
-
122
- @generated function _pullback (ctx:: AContext , :: typeof (literal_getproperty), x, f)
123
- _generate_literal_getproperty (ctx, nothing , x, f)
124
- end
125
-
126
- end
0 commit comments