Repository navigation
Move embedded-NUL error of cconvert(Cstring, ::InlineString) into @noinline function - #101
Merged
quinnj-bot[bot] merged 1 commit intoNov 25, 2026
Conversation
…@noinline` function The inline `repr` call made `cconvert` infer the whole `show` machinery. Downstream code that calls `cconvert(Cstring, ::Any)` then gets invalidated by unrelated `promote_rule` methods. Claude-Session: https://claude.ai/code/session_011JVX1FUvj2TmSZj7moQwDk
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #101 +/- ##
==========================================
+ Coverage 91.80% 91.82% +0.02%
==========================================
Files 5 5
Lines 744 746 +2
==========================================
+ Hits 683 685 +2
Misses 61 61 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
[review generated via AI] Thanks @ParadaCarleton, this looks good.
- Behavior is unchanged. The error type and message are the same; the message is now built only when the error is thrown, in a
@noinlinefunction. The tightened test pins the full message. - CI. The package's own jobs pass on 1.10, 1 and pre, and so do the Parsers 2/3 jobs.
- The TimeZones.jl integration failure is pre-existing. It fails the same way on
main(9 failures in TimeZones' own tests in the Nov 19 runs), so it isn't caused by this PR.
🤖 Generated with Claude Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The inline
reprmadecconvertinfer the wholeshowmachinery for the error path. When downstream code callscconvert(Cstring, x)withx::Any, inference visits this method and records edges into that machinery. Any package that later defines apromote_rulefor its own number type then invalidates the downstream code. With a separate@noinlinefunction, inference stops at its call.Evidence
Measured in Corset.jl, with a test that loads a package defining
promote_rulefor its own number type:convert(String, ::WeakRefString).stringJuliaData/WeakRefStrings.jl#112.The existing embedded-NUL test now also checks the error message, which stays the same. The full suite passes locally on Julia 1.13.
Merge Danger
Door: two-way
Blast Radius: none. The error type and message stay the same.
https://claude.ai/code/session_011JVX1FUvj2TmSZj7moQwDk