Skip to content

Use Meta.lower instead of ccall(:jl_expand) - #104

Merged
CarloLucibello merged 1 commit into
FluxML:masterfrom
IanButterworth:ib/fix_jl_expand
Aug 6, 2026
Merged

CarloLucibello merged 1 commit into
FluxML:masterfrom
IanButterworth:ib/fix_jl_expand

Conversation

@IanButterworth

Copy link
Copy Markdown
Contributor

Claude:


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.

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) <noreply@anthropic.com>
@simeonschaub

Copy link
Copy Markdown
Member

Do you also want to bump the version in the Project.toml, so we can get a new release out right away?

@CarloLucibello

Copy link
Copy Markdown
Member

version bumbed in a pr I just merged, so I'll merge also this and tag a release

@CarloLucibello
CarloLucibello merged commit b1983b1 into FluxML:master Aug 6, 2026
6 checks passed
@IanButterworth
IanButterworth deleted the ib/fix_jl_expand branch August 6, 2026 11:02
@IanButterworth

Copy link
Copy Markdown
Contributor Author

Thanks. Would you mind reporting here when the release is tagged, as this unblocks some work. Much appreciated.

@CarloLucibello

Copy link
Copy Markdown
Member

done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants