Skip to content

Commit 2bbcead

Browse files
authored
Fix builtins (#664)
Compensates for the accidental push of aca346c
1 parent aca346c commit 2bbcead

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

bin/generate_builtins.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ const RECENTLY_ADDED = Core.Builtin[
2222
setfieldonce!,
2323
setglobalonce!,
2424
swapglobal!,
25+
Core._defaultctors,
26+
# Recently became builtins
27+
Base.invokelatest,
28+
Base.invoke_in_world,
2529
]
2630
# Builtins present from 1.10, not builtins (potentially still normal functions) anymore
2731
const RECENTLY_REMOVED = GlobalRef.(Ref(Core), [

src/builtins.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ function maybe_evaluate_builtin(frame, call_expr, expand::Bool)
8686
return Some{Any}(Core._call_in_world_total(getargs(args, frame)...))
8787
elseif f === Core._compute_sparams
8888
return Some{Any}(Core._compute_sparams(getargs(args, frame)...))
89-
elseif f === Core._defaultctors
89+
elseif @static isdefined(Core, :_defaultctors) && f === Core._defaultctors
9090
return Some{Any}(Core._defaultctors(getargs(args, frame)...))
9191
elseif f === Core._equiv_typedef
9292
return Some{Any}(Core._equiv_typedef(getargs(args, frame)...))
@@ -150,9 +150,9 @@ function maybe_evaluate_builtin(frame, call_expr, expand::Bool)
150150
else
151151
return Some{Any}(Core.ifelse(getargs(args, frame)...))
152152
end
153-
elseif f === Core.invoke_in_world
153+
elseif @static isdefined(Core, :invoke_in_world) && f === Core.invoke_in_world
154154
return Some{Any}(Core.invoke_in_world(getargs(args, frame)...))
155-
elseif f === Core.invokelatest
155+
elseif @static isdefined(Core, :invokelatest) && f === Core.invokelatest
156156
return Some{Any}(Core.invokelatest(getargs(args, frame)...))
157157
elseif @static isdefined(Core, :memorynew) && f === Core.memorynew
158158
if nargs == 2

0 commit comments

Comments
 (0)