Skip to content

Fix @register_symbolic when Symbolics is not in caller namespace#1810

Open
asinghvi17 wants to merge 1 commit into
JuliaSymbolics:masterfrom
asinghvi17:as/fix-register-symbolic-interpolation
Open

Fix @register_symbolic when Symbolics is not in caller namespace#1810
asinghvi17 wants to merge 1 commit into
JuliaSymbolics:masterfrom
asinghvi17:as/fix-register-symbolic-interpolation

Conversation

@asinghvi17
Copy link
Copy Markdown
Contributor

Summary

  • Interpolate Symbolics module reference in @register_symbolic and register_array_symbolic macro-generated code so callers don't need Symbolics in their namespace
  • Previously, using Symbolics: @register_symbolic followed by @register_symbolic f(...) would error with UndefVarError: Symbolics not defined
  • Adds test for this case

Test plan

  • Verified using Symbolics: @register_symbolic works in an isolated module
  • CI: Core test group passes

🤖 Generated with Claude Code

…ated code

`@register_symbolic` and `register_array_symbolic` emitted
`Symbolics.@wrapped` / `@wrapped` as literal references in `esc()`'d
output, requiring `Symbolics` to be in the caller's namespace. This
broke when users did `using Symbolics: @register_symbolic` without
importing the full module.

Fix by interpolating `$(Symbolics)` so the module object is captured at
macro-expansion time.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Feb 25, 2026

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 26.13%. Comparing base (bd13ae9) to head (e835b20).
⚠️ Report is 23 commits behind head on master.

Files with missing lines Patch % Lines
src/register.jl 50.00% 1 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1810      +/-   ##
==========================================
- Coverage   26.15%   26.13%   -0.03%     
==========================================
  Files          56       56              
  Lines        5329     5350      +21     
==========================================
+ Hits         1394     1398       +4     
- Misses       3935     3952      +17     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@asinghvi17
Copy link
Copy Markdown
Contributor Author

I have 0 clue why tests are failing here, maybe @ChrisRackauckas-Claude has some idea?

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.

2 participants