Skip to content

Document hex literal range behavior on signed types - #595

Merged
SeanTAllen merged 1 commit into
mainfrom
document-hex-signed-range
Sep 7, 2026
Merged

Document hex literal range behavior on signed types#595
SeanTAllen merged 1 commit into
mainfrom
document-hex-signed-range

Conversation

@SeanTAllen

Copy link
Copy Markdown
Member

The tutorial's literals page didn't mention what happens when a hex literal exceeds a signed type's positive range. A user hit this with 0x80006000 on I32 and filed ponylang/ponyc#6011.

Adds a short subsection after the existing hex/binary example explaining that integer literals are positive values, the compiler rejects them when they exceed the type's maximum, and you negate the positive form to get a negative hex value.

@netlify

netlify Bot commented Sep 7, 2026

Copy link
Copy Markdown

Deploy Preview for pony-tutorial ready!

Name Link
🔨 Latest commit 1175dd3
🔍 Latest deploy log https://app.netlify.com/projects/pony-tutorial/deploys/6a9ed10d7a8f390008e57e5c
😎 Deploy Preview https://deploy-preview-595--pony-tutorial.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@ponylang-main ponylang-main added the discuss during sync Should be discussed during an upcoming sync label Sep 7, 2026
The tutorial's literals page mentioned hex and binary as notation
options but never explained the prefixes or what happens when a hex
value exceeds a signed type's range. A user hit this with
`0x80006000` on I32 (ponylang/ponyc#6011).

Adds a "Hex and Binary Literals" subsection that introduces the `0x`
and `0b` prefixes, explains that hex and binary literals are always
positive values, and shows how to negate the positive form when you
need a negative hex constant on a signed type.
@SeanTAllen
SeanTAllen force-pushed the document-hex-signed-range branch from 4678e2d to 1175dd3 Compare September 7, 2026 14:58
@SeanTAllen
SeanTAllen merged commit f373674 into main Sep 7, 2026
9 checks passed
@SeanTAllen
SeanTAllen deleted the document-hex-signed-range branch September 7, 2026 14:59
@ponylang-main ponylang-main removed the discuss during sync Should be discussed during an upcoming sync label Sep 7, 2026
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.

2 participants