Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust to upcoming julia#54341 #125

Merged
merged 1 commit into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/eval.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ function build_codeinfo(ir::IR)
push!(ci.slotnames, Symbol(""))
push!(ci.slotflags, 0)
end
if isdefined(Base, :__has_internal_change) && Base.__has_internal_change(v"1.12-alpha", :codeinfonargs)
ci.nargs = length(arguments(ir)) + 1
ci.isva = false
end
argument!(ir, at = 1)
update!(ci, ir)
end
Expand Down
8 changes: 8 additions & 0 deletions src/reflection/dynamo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ function dynamo(cache, world, f, args...)
m === nothing && error("Error looking up metadata for $f")
m.code.method_for_inference_limit_heuristics = nothing
end
if isdefined(Base, :__has_internal_change) && Base.__has_internal_change(v"1.12-alpha", :codeinfonargs)
m.code.nargs = 2
m.code.isva = true
end
_self = splicearg!(ir)
prewalk!(x -> x === self ? _self : x, ir)
return update!(m.code, ir)
Expand All @@ -112,6 +116,10 @@ function dynamo_lambda(cache, world, f::Type{<:Lambda{S,I}}) where {S,I}
closureargs!(ir)
m = @meta world dummy(1)
m.code.method_for_inference_limit_heuristics = nothing
if isdefined(Base, :__has_internal_change) && Base.__has_internal_change(v"1.12-alpha", :codeinfonargs)
m.code.nargs = 2
m.code.isva = true
end
return update!(m.code, ir)
end

Expand Down
Loading