Allow character literals in integer contexts - #382
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
julia-script
marked this pull request as ready for review
September 7, 2026 17:45
…ual-character-literals
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.
Character literals now take an immediate integer context using their Unicode scalar number. Previously,
let byte: u8 = 'A'failed with a char/u8 mismatch.Existing char values still require explicit conversion. Invalid Unicode scalars remain invalid in every context. Expression analysis, primitive constants and static literal evaluation use the same integer range rules; SEM0002 now reports the selected type and exact bounds. Reference documentation and OpenSpec describe the behavior.
Tracks JUL-157. OpenSpec:
contextual-character-literals.Validation:
pnpm typecheck,pnpm format:check,pnpm lint, 149 focused compiler tests, the native character acceptance witness, generated documentation checks and strict OpenSpec validation.pnpm testencountered timeouts in IntrinsicCatalog and Layout (2,367 compiler tests passed); both files passed in isolation (41 tests). A retry hit a documentation-example timeout. These failures are not established as pre-existing. Julia explicitly requested stopping local broad runs and handing verification to CI because other sessions are running tests.pnpm checkandpnpm release:candidatehave not passed locally. CI runs the equivalent split validation gates, compiler/native shards and release-candidate check. OpenSpec task 2.3 remains pending CI.Test economics: the change adds two frontend tests in an existing file, extends shared analysis/static assertions, and extends the existing native corpus witness; it adds no test file or runtime matrix. Independent general and dedicated test-economics reviewers inspected the committed diff. Comparable runtime delta is not established under concurrent local load; further measurement is deferred with the remaining verification to CI. Baseline CharacterLiteral + StaticText: 3.67s total / 446ms test time; final focused three-file run: 30.45s (different scope, not a delta).
Main risk: broader regression and package-validation results are still pending CI.