Skip to content

Error for overflowing integer literals#8448

Open
isuffix wants to merge 2 commits into
typst:mainfrom
isuffix:int-error-in-ast
Open

Error for overflowing integer literals#8448
isuffix wants to merge 2 commits into
typst:mainfrom
isuffix:int-error-in-ast

Conversation

@isuffix

@isuffix isuffix commented Jun 6, 2026

Copy link
Copy Markdown
Collaborator

This is the more constrained of two followup PRs for #8445 based on discussion from #7389. Only the last two commits are unique.

This PR causes us to error for overflowing integer literals instead of treating them as floats. However, we only error during evaluation so that we still highlight invalid integer literals as integers.

I have included tests for this highlighting behavior and that we don't error if the integer value isn't evaluated.

I have also finally added a NonDecimalBase enum to make our non-decimal handling more semantic.

And I've added a more complete description of our integer syntax to the docs.

@isuffix isuffix force-pushed the int-error-in-ast branch 3 times, most recently from 354bd5e to 74af696 Compare June 6, 2026 18:59
@isuffix isuffix added diagnostics Improvements to compiler errors foundations Related to the foundations category, which contains foundational types and elements. labels Jun 6, 2026
@isuffix isuffix changed the title Error for overflowing integer literals in evaluation Error for overflowing integer literals Jun 6, 2026
@isuffix isuffix force-pushed the int-error-in-ast branch 2 times, most recently from 632da30 to c5672df Compare June 9, 2026 03:24
@isuffix isuffix force-pushed the int-error-in-ast branch from c5672df to d68af5e Compare June 9, 2026 19:23
@laurmaedje laurmaedje added the waiting-on-review This PR is waiting to be reviewed. label Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

diagnostics Improvements to compiler errors foundations Related to the foundations category, which contains foundational types and elements. waiting-on-review This PR is waiting to be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants