Skip to content

Commit 6b7d530

Browse files
authored
Fix some precompile directives that weren't working (#38349)
This adds a few more precompiles and also converts some into direct calls to `precompile`. It's not entirely clear why the old one didn't work.
1 parent 4b88a60 commit 6b7d530

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

contrib/generate_precompile.jl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,22 @@ UP_ARROW = "\e[A"
1515
DOWN_ARROW = "\e[B"
1616

1717
hardcoded_precompile_statements = """
18-
# used by Revise.jl
18+
# used by JuliaInterpreter.jl and Revise.jl
1919
@assert precompile(Tuple{typeof(Base.parse_cache_header), String})
2020
@assert precompile(Tuple{typeof(pushfirst!), Vector{Any}, Function})
21+
@assert precompile(Tuple{typeof(push!), Set{Module}, Module})
22+
@assert precompile(Tuple{typeof(push!), Set{Method}, Method})
23+
@assert precompile(Tuple{typeof(empty!), Set{Any}})
2124
# used by Requires.jl
2225
@assert precompile(Tuple{typeof(get!), Type{Vector{Function}}, Dict{Base.PkgId,Vector{Function}}, Base.PkgId})
2326
@assert precompile(Tuple{typeof(haskey), Dict{Base.PkgId,Vector{Function}}, Base.PkgId})
2427
@assert precompile(Tuple{typeof(delete!), Dict{Base.PkgId,Vector{Function}}, Base.PkgId})
2528
@assert precompile(Tuple{typeof(push!), Vector{Function}, Function})
2629
# miscellaneous
2730
@assert precompile(Tuple{typeof(Base.require), Base.PkgId})
31+
@assert precompile(Tuple{typeof(Base.recursive_prefs_merge), Base.Dict{String, Any}})
2832
@assert precompile(Tuple{typeof(isassigned), Core.SimpleVector, Int})
33+
@assert precompile(Tuple{typeof(getindex), Core.SimpleVector, Int})
2934
@assert precompile(Tuple{typeof(Base.Experimental.register_error_hint), Any, Type})
3035
"""
3136

@@ -50,9 +55,6 @@ cd("complet_path\t\t$CTRL_C
5055
"""
5156

5257
precompile_script = """
53-
# Used by JuliaInterpreter
54-
push!(Set{Module}(), Main)
55-
push!(Set{Method}(), first(methods(collect)))
5658
# Used by Revise
5759
(setindex!(Dict{String,Base.PkgId}(), Base.PkgId(Base), "file.jl"))["file.jl"]
5860
(setindex!(Dict{Base.PkgId,String}(), "file.jl", Base.PkgId(Base)))[Base.PkgId(Base)]

0 commit comments

Comments
 (0)