-
Notifications
You must be signed in to change notification settings - Fork 364
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
conversion to uint64
is bounded to int64
values (when passing as a literal)
#1085
Milestone
Comments
thehowl
added
🐞 bug
Something isn't working
📦 🤖 gnovm
Issues or PRs gnovm related
labels
Aug 30, 2023
7 tasks
7 tasks
deelawn
added a commit
that referenced
this issue
Jan 11, 2024
<!-- please provide a detailed description of the changes made in this pull request. --> Addresses #1085 The call to `convConst` should include the type in this case. This happens while processing a `CallExpr` and in this case the expression is a function call to the built function `uint64`. We have the expected type, so use when converting the constant to a typed value. If this type is still nil, then it will behave as it does currently. However, the concrete type should only be supplied to `convertConst` if the call expression's type and the constant expression's type both have the same underlying _unsigned type_ -- the base type of any value of these types were they to be evaluated as literals before being assigned a type. <details><summary>Contributors' checklist...</summary> - [x] Added new tests, or not needed, or not feasible - [ ] Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory - [ ] Updated the official documentation or not needed - [ ] No breaking changes were made, or a `BREAKING CHANGE: xxx` message was included in the description - [x] Added references to related issues and PRs - [ ] Provided any useful hints for running manual tests - [ ] Added new benchmarks to [generated graphs](https://gnoland.github.io/benchmarks), if any. More info [here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md). </details>
gfanton
pushed a commit
to moul/gno
that referenced
this issue
Jan 18, 2024
<!-- please provide a detailed description of the changes made in this pull request. --> Addresses gnolang#1085 The call to `convConst` should include the type in this case. This happens while processing a `CallExpr` and in this case the expression is a function call to the built function `uint64`. We have the expected type, so use when converting the constant to a typed value. If this type is still nil, then it will behave as it does currently. However, the concrete type should only be supplied to `convertConst` if the call expression's type and the constant expression's type both have the same underlying _unsigned type_ -- the base type of any value of these types were they to be evaluated as literals before being assigned a type. <details><summary>Contributors' checklist...</summary> - [x] Added new tests, or not needed, or not feasible - [ ] Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory - [ ] Updated the official documentation or not needed - [ ] No breaking changes were made, or a `BREAKING CHANGE: xxx` message was included in the description - [x] Added references to related issues and PRs - [ ] Provided any useful hints for running manual tests - [ ] Added new benchmarks to [generated graphs](https://gnoland.github.io/benchmarks), if any. More info [here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md). </details>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
all of the following fail:
The only way to use a large literal like that is the following:
(Part of a series of issues encountered while developing gnochess)
The text was updated successfully, but these errors were encountered: