From 0f593da4e5763b8a36842a80f668a074cbd48719 Mon Sep 17 00:00:00 2001 From: Ian Butterworth Date: Wed, 5 Aug 2026 15:52:53 -0400 Subject: [PATCH] Use Meta.lower instead of ccall(:jl_expand) Julia 1.13 moved lowering behind `Core._lower` and the `jl_expand` symbol no longer exists, so `__cacheget_generator__` failed with "could not load symbol jl_expand" on every `fmap` call. `Meta.lower(m, x)` is the public wrapper for the same operation: it calls `ccall(:jl_expand, Any, (Any, Any), x, m)` up to 1.12 and `Core._lower` from 1.13. It is therefore used unconditionally on all supported versions rather than behind a VERSION branch, and is an exact equivalent of the previous ccall on 1.10-1.12. Tests pass on 1.10, 1.11, 1.12, 1.13.0-rc1 and 1.14.0-DEV, including the `@inferred` test in test/cache.jl that covers the generated typeassert. Co-Authored-By: Claude Opus 5 (1M context) --- src/cache.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cache.jl b/src/cache.jl index fd6bc8f..385c402 100644 --- a/src/cache.jl +++ b/src/cache.jl @@ -21,7 +21,7 @@ function __cacheget_generator__(world, source, self, cache, x, args #= for `retu end expr = Expr(:lambda, [Symbol("#self#"), :cache, :x, :args], Expr(Symbol("scope-block"), Expr(:block, Expr(:meta, :inline), Expr(:return, body)))) - ci = ccall(:jl_expand, Any, (Any, Any), expr, @__MODULE__) + ci = Meta.lower(@__MODULE__, expr) ci.inlineable = true if hasfield(Core.CodeInfo, :nargs) ci.nargs = 4