Skip to content

Commit d148eb2

Browse files
authored
improve precompile generation for vararg signatures (#37715)
1 parent 197c8c5 commit d148eb2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

contrib/generate_precompile.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,9 @@ function generate_precompile_statements()
235235
n_succeeded = 0
236236
include_time = @elapsed for statement in sort(collect(statements))
237237
# println(statement)
238+
# The compiler has problem caching signatures with `Vararg{?, N}`. Replacing
239+
# N with a large number seems to work around it.
240+
statement = replace(statement, r"Vararg{(.*?), N} where N" => s"Vararg{\1, 100}")
238241
try
239242
Base.include_string(PrecompileStagingArea, statement)
240243
n_succeeded += 1

0 commit comments

Comments
 (0)