feat: add support for unsigned integer MIN and MAX type bounds#277
feat: add support for unsigned integer MIN and MAX type bounds#277metalurgical wants to merge 1 commit intoBlockstreamResearch:masterfrom
Conversation
|
Thanks for the contribution! Overall it LGTM, but there is a nuance with errors |
|
So now with this example: Error changed from:
to things like:
|
Thanks for pointing this out. +1 |
|
Nevertheless, would like to hear your opinion on this |
Introduce parser support for unsigned integer constants (MIN, MAX) across all variants. Can be further extended easily to include other type specific constants like ZERO, ONE in future.
I had incorrectly assumed this case would have been caught by existing tests. Additional tests have been added around this and corrected the implementation here. |
|
just for context, waiting for the second review before merging |
stringhandler
left a comment
There was a problem hiding this comment.
Long time, Strider, I hope you are well. I think it would actually be better to model this properly. It's a Const or a Call at best, rather than a new unique language feature. I would rather say we should treat it as an Ident on the lexer, a Constant(ConstantName) on the parser and AST level, kind of how we do Call. It could maybe even be written as a call.
@stringhandler It has been and likewise.
The current approach was intentionally limited to address the immediate issue with minimal changes, while leaving room for future extension if needed. I agree that modelling this as part of a more general language construct would be both sound and a cleaner long-term solution. The current approach is contained such that it does not prevent transitioning to that model in future. |

Introduce parser support for unsigned integer constants (MIN, MAX) across all variants.
Can be further extended easily to include other type specific constants like ZERO, ONE, etc in future.
Extensible for future types that need specific constants as well, without interfering with existing constant types.