Skip to content

Commit 13ef72c

Browse files
mlechuaviatesk
authored andcommitted
Adapt to different GeneratedFunctionStub signature, add a worldinc
Signature changed in JuliaLang/julia#57230. Thanks @aviatesk for the help!
1 parent 9a9d79b commit 13ef72c

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/desugaring.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2473,6 +2473,7 @@ function expand_function_generator(ctx, srcref, callex_srcref, func_name, func_n
24732473
# Code generator definition
24742474
gen_func_method_defs = @ast ctx srcref [K"block"
24752475
[K"function_decl" gen_name]
2476+
[K"latestworld_if_toplevel"]
24762477
[K"scope_block"(scope_type=:hard)
24772478
[K"method_defs"
24782479
gen_name

src/runtime.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ end
282282
# expression into a CodeInfo.
283283
#
284284
# `args` passed into stub by the Julia runtime are (parent_func, static_params..., arg_types...)
285-
function (g::GeneratedFunctionStub)(world::UInt, source::LineNumberNode, @nospecialize args...)
285+
function (g::GeneratedFunctionStub)(world::UInt, source::Method, @nospecialize args...)
286286
# Some of the lowering pipeline from lower() and the pass-specific setup is
287287
# re-implemented here because generated functions are very much (but not
288288
# entirely) like macro expansion.
@@ -334,7 +334,7 @@ function (g::GeneratedFunctionStub)(world::UInt, source::LineNumberNode, @nospec
334334
ctx2, ex2 = expand_forms_2( ctx1, ex1)
335335

336336
# Wrap expansion in a non-toplevel lambda and run scope resolution
337-
ex2 = @ast ctx2 source [K"lambda"(is_toplevel_thunk=false)
337+
ex2 = @ast ctx2 ex0 [K"lambda"(is_toplevel_thunk=false)
338338
[K"block"
339339
(string(n)::K"Identifier" for n in g.argnames)...
340340
]

0 commit comments

Comments
 (0)