Skip to content
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

We didn't set File line on ValueDeclr ImportDecl, TypeDecl #2220

Closed
omarsy opened this issue May 27, 2024 · 0 comments · Fixed by #2221
Closed

We didn't set File line on ValueDeclr ImportDecl, TypeDecl #2220

omarsy opened this issue May 27, 2024 · 0 comments · Fixed by #2221
Assignees

Comments

@omarsy
Copy link
Member

omarsy commented May 27, 2024

Description:

The following code snippet produces an error in Gnolang, but the error message is misleading and does not point to the correct line number.

Code to Reproduce:

package main

func main() {
  var a, b, c = 1, 2
}

Expected Behavior:

The code should either compile correctly or produce a clear error message indicating the exact issue and the correct line number.

Actual Behavior:

The code returns the following error:

panic: main//src/package.gno:3: should not happen

The part "main//src/package.gno:3:" is not accurate because it does not set the line number of the ValuDelr type correctly. Instead, it takes the line number of the blocknode, which is misleading.

@omarsy omarsy mentioned this issue May 27, 2024
7 tasks
@Kouteki Kouteki moved this from Triage to In Progress in 🧙‍♂️gno.land core team May 31, 2024
thehowl pushed a commit that referenced this issue Jun 3, 2024
Closes #2220
<!-- please provide a detailed description of the changes made in this
pull request. -->

<details><summary>Contributors' checklist...</summary>

- [ ] 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
- [ ] 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>
@github-project-automation github-project-automation bot moved this from In Progress to Done in 🧙‍♂️gno.land core team Jun 3, 2024
omarsy added a commit to TERITORI/gno that referenced this issue Jun 3, 2024
Closes gnolang#2220
<!-- please provide a detailed description of the changes made in this
pull request. -->

<details><summary>Contributors' checklist...</summary>

- [ ] 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
- [ ] 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
Labels
None yet
Projects
Development

Successfully merging a pull request may close this issue.

1 participant