-
-
Notifications
You must be signed in to change notification settings - Fork 367
Deprecate old numeric suffix syntax (e.g., 123u64) #8884
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
Add deprecation error for old-style numeric suffixes like `123u64` or `3.14f64`. The error suggests using the new syntax (e.g., `123.U64`) instead. The old syntax still works but emits a deprecation diagnostic. This allows existing code to continue working while encouraging migration to the new syntax. Changes: - Add deprecated_number_suffix diagnostic type - Emit deprecation errors in canonicalizer for int/frac expressions and patterns - Update tests to use type annotations instead of deprecated suffixes - Update snapshots to include deprecation warnings 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Changed all test files from old suffix syntax (123u64, 3.14f64) to new syntax (123.U64, 3.14.F64) - Added formatter support for typed_int and typed_frac expressions - Updated f64_pattern_literal_error test to reflect that typed suffixes aren't supported in patterns (now shows parse errors instead of semantic errors) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This test was for typed suffixes in patterns, but typed suffixes don't exist in pattern syntax. The "F64 NOT ALLOWED IN PATTERN" error is already tested by pattern_f64_overflow.md using untyped floats that exceed Dec precision. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
rtfeldman
added a commit
that referenced
this pull request
Jan 3, 2026
Update the test to use the new typed numeric suffix syntax (0.I64 instead of 0u8) and correct the expected error type. This was broken in PR #8884. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
3 tasks
rtfeldman
added a commit
that referenced
this pull request
Jan 3, 2026
Update the test to use the new typed numeric suffix syntax (0.I64 instead of 0u8) and correct the expected error type. This was broken in PR #8884. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
rtfeldman
added a commit
that referenced
this pull request
Jan 3, 2026
When parsing number literals like `0.F`, the tokenizer produces `Int,NoSpaceDotUpperIdent` which the parser interprets as a typed integer with type suffix `.F`. Previously, this invalid type suffix would cause a crash later in evaluation. This commit adds validation during canonicalization to check that the type suffix refers to a type that is actually in scope. If the type is not in scope (like `F` in `0.F`), the expression is replaced with e_runtime_error and a proper "UNDECLARED TYPE" diagnostic is emitted. Also includes a fix for the broken "check type - for mismatch" test after the numeric suffix deprecation (from PR #8884). Fixes #8893 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
rtfeldman
added a commit
that referenced
this pull request
Jan 3, 2026
When parsing number literals like `0.F`, the tokenizer produces `Int,NoSpaceDotUpperIdent` which the parser interprets as a typed integer with type suffix `.F`. Previously, this invalid type suffix would cause a crash later in evaluation. This commit adds validation during canonicalization to check that the type suffix refers to a type that is actually in scope. If the type is not in scope (like `F` in `0.F`), the expression is replaced with e_runtime_error and a proper "UNDECLARED TYPE" diagnostic is emitted. Also includes a fix for the broken "check type - for mismatch" test after the numeric suffix deprecation (from PR #8884). Fixes #8893 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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
123u64or3.14f64123.U64) insteadChanges
deprecated_number_suffixdiagnostic type toDiagnostic.zigTest plan
zig build test- All 2189 tests passzig build minici- All checks pass🤖 Generated with Claude Code