Skip to content

Commit 9d0cce0

Browse files
committed
rework implementation
1 parent 0212df1 commit 9d0cce0

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

src/construct.jl

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -88,18 +88,14 @@ end
8888

8989
get_source(meth::Method) = Base.uncompressed_ast(meth)
9090

91-
@static if VERSION < v"1.12.0-DEV.1968" # julia #57230
92-
function get_source(g::GeneratedFunctionStub, env, file, line::Int)
93-
b = g(Base.get_world_counter(), LineNumberNode(line, file), env..., g.argnames...)
94-
b isa CodeInfo && return b
95-
return eval(b)
96-
end
97-
else
98-
function get_source(g::GeneratedFunctionStub, source::Method, env)
99-
b = g(Base.get_world_counter(), source, env..., g.argnames...)
100-
b isa CodeInfo && return b
101-
return eval(b)
91+
function get_source(g::GeneratedFunctionStub, source::Method, env)
92+
b = @static if VERSION < v"1.12.0-DEV.1968" # julia #57230
93+
g(Base.get_world_counter(), LineNumberNode(source.line, source.file), env..., g.argnames...)
94+
else
95+
g(Base.get_world_counter(), source, env..., g.argnames...)
10296
end
97+
b isa CodeInfo && return b
98+
return eval(b)
10399
end
104100

105101
"""
@@ -159,11 +155,7 @@ function prepare_framecode(method::Method, @nospecialize(argtypes); enter_genera
159155
generator = false
160156
else
161157
if is_generated(method)
162-
code = @static if VERSION < v"1.12.0-DEV.1968" # julia #57230
163-
get_source(method.generator, lenv, method.file, Int(method.line))
164-
else
165-
get_source(method.generator, method, lenv)
166-
end
158+
code = get_source(method.generator, method, lenv)
167159
generator = true
168160
else
169161
code = get_source(method)

0 commit comments

Comments
 (0)