12
12
const _uncompress = Base. _uncompressed_ast
13
13
end
14
14
15
+ if VERSION < v " 1.6-"
15
16
structdata (meth:: Method ) =
16
17
[meth. module, meth. name, meth. file, meth. line, meth. sig, getfield (meth, syms_fieldname),
17
18
meth. ambig, meth. nargs, meth. isva, meth. nospecialize,
18
19
_uncompress (meth, meth. source)]
20
+ else
21
+ structdata (meth:: Method ) =
22
+ [meth. module, meth. name, meth. file, meth. line, meth. sig, getfield (meth, syms_fieldname),
23
+ meth. nargs, meth. isva, meth. nospecialize, _uncompress (meth, meth. source)]
24
+ end
19
25
20
26
initstruct (:: Type{Method} ) = ccall (:jl_new_method_uninit , Ref{Method}, (Any,), Main)
21
27
28
+ if VERSION < v " 1.6-"
22
29
function newstruct! (meth:: Method , mod, name, file, line, sig,
23
30
syms, ambig, nargs, isva, nospecialize, ast)
24
31
meth. module = mod
@@ -35,6 +42,23 @@ function newstruct!(meth::Method, mod, name, file, line, sig,
35
42
meth. pure = ast. pure
36
43
return meth
37
44
end
45
+ else
46
+ function newstruct! (meth:: Method , mod, name, file, line, sig,
47
+ syms, nargs, isva, nospecialize, ast)
48
+ meth. module = mod
49
+ meth. name = name
50
+ meth. file = file
51
+ meth. line = line
52
+ meth. sig = sig
53
+ setfield! (meth, syms_fieldname, syms)
54
+ meth. nospecialize = nospecialize
55
+ meth. nargs = nargs
56
+ meth. isva = isva
57
+ meth. source = ast
58
+ meth. pure = ast. pure
59
+ return meth
60
+ end
61
+ end
38
62
39
63
function structdata (t:: TypeName )
40
64
primary = Base. unwrap_unionall (t. wrapper)
0 commit comments