33
33
copy_code_info (code_info) = copy (code_info)
34
34
end
35
35
36
+ if VERSION < v " 1.2.0-DEV.573"
37
+ specialize_method (method, metharg, methsp, world, force) = Core. Compiler. code_for_method (method, metharg, methsp, world, force)
38
+ else
39
+ specialize_method (method, metharg, methsp, world, force) = Core. Compiler. specialize_method (method, metharg, methsp, force)
40
+ end
41
+
42
+
43
+
36
44
# Return `Reflection` for signature `sigtypes` and `world`, if possible. Otherwise, return `nothing`.
37
45
function reflect (@nospecialize (sigtypes:: Tuple ), world:: UInt = typemax (UInt))
38
46
if length (sigtypes) > 2 && sigtypes[1 ] === typeof (invoke)
@@ -63,7 +71,7 @@ function reflect(@nospecialize(sigtypes::Tuple), world::UInt = typemax(UInt))
63
71
end
64
72
method_index === 0 && return nothing
65
73
type_signature, raw_static_params, method = _methods[method_index]
66
- method_instance = Core . Compiler . code_for_method (method, type_signature, raw_static_params, world, false )
74
+ method_instance = specialize_method (method, type_signature, raw_static_params, world, false )
67
75
method_instance === nothing && return nothing
68
76
method_signature = method. sig
69
77
static_params = Any[raw_static_params... ]
@@ -497,6 +505,7 @@ recurse(ctx::Context, ::typeof(Core._apply), f, args...) = Core._apply(recurse,
497
505
function overdub_definition (line, file)
498
506
return quote
499
507
function $Cassette. overdub ($ OVERDUB_CONTEXT_NAME:: $Cassette.Context , $ OVERDUB_ARGUMENTS_NAME... )
508
+ $ (Expr (:meta , :generated_only ))
500
509
$ (Expr (:meta ,
501
510
:generated ,
502
511
Expr (:new ,
@@ -509,6 +518,7 @@ function overdub_definition(line, file)
509
518
true )))
510
519
end
511
520
function $Cassette. recurse ($ OVERDUB_CONTEXT_NAME:: $Cassette.Context , $ OVERDUB_ARGUMENTS_NAME... )
521
+ $ (Expr (:meta , :generated_only ))
512
522
$ (Expr (:meta ,
513
523
:generated ,
514
524
Expr (:new ,
0 commit comments