Skip to content

Allow character literals in integer contexts - #382

Merged
julia-script merged 2 commits into
mainfrom
julia/jul-157-contextual-character-literals
Sep 7, 2026
Merged

Allow character literals in integer contexts#382
julia-script merged 2 commits into
mainfrom
julia/jul-157-contextual-character-literals

Conversation

@julia-script

Copy link
Copy Markdown
Owner

Character literals now take an immediate integer context using their Unicode scalar number. Previously, let byte: u8 = 'A' failed with a char/u8 mismatch.

let letter = 'A'        // char
let byte: u8 = 'A'      // 65
let accent: u8 = 'é'    // 233
let invalid: u8 = '☃'   // compile-time range error

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:

  • Passed locally: pnpm typecheck, pnpm format:check, pnpm lint, 149 focused compiler tests, the native character acceptance witness, generated documentation checks and strict OpenSpec validation.
  • Full pnpm test encountered 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.
  • Full pnpm check and pnpm release:candidate have 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.

@vercel

vercel Bot commented Sep 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
silk-effect-docs Ready Ready Preview Sep 7, 2026 6:09pm UTC

Request Review

@julia-script
julia-script merged commit 17e67d9 into main Sep 7, 2026
14 of 15 checks passed
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.

1 participant