Skip to content

fix(preprocess): using iota outside constant declaration#5822

Open
Villaquiranm wants to merge 2 commits into
gnolang:masterfrom
Villaquiranm:fix/5668-iota-outside-constant-declaration
Open

fix(preprocess): using iota outside constant declaration#5822
Villaquiranm wants to merge 2 commits into
gnolang:masterfrom
Villaquiranm:fix/5668-iota-outside-constant-declaration

Conversation

@Villaquiranm

@Villaquiranm Villaquiranm commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

closes #5668

@github-actions github-actions Bot added the 📦 🤖 gnovm Issues or PRs gnovm related label Jun 12, 2026
@Gno2D2 Gno2D2 added the review/triage-pending PRs opened by external contributors that are waiting for the 1st review label Jun 12, 2026
@Gno2D2

Gno2D2 commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

🛠 PR Checks Summary

All Automated Checks passed. ✅

Manual Checks (for Reviewers):
  • IGNORE the bot requirements for this PR (force green CI check)
Read More

🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers.

✅ Automated Checks (for Contributors):

🟢 Maintainers must be able to edit this pull request (more info)
🟢 Pending initial approval by a review team member, or review from tech-staff

☑️ Contributor Actions:
  1. Fix any issues flagged by automated checks.
  2. Follow the Contributor Checklist to ensure your PR is ready for review.
    • Add new tests, or document why they are unnecessary.
    • Provide clear examples/screenshots, if necessary.
    • Update documentation, if required.
    • Ensure no breaking changes, or include BREAKING CHANGE notes.
    • Link related issues/PRs, where applicable.
☑️ Reviewer Actions:
  1. Complete manual checks for the PR, including the guidelines and additional checks if applicable.
📚 Resources:
Debug
Automated Checks
Maintainers must be able to edit this pull request (more info)

If

🟢 Condition met
└── 🟢 And
    ├── 🟢 The base branch matches this pattern: ^master$
    └── 🟢 The pull request was created from a fork (head branch repo: Villaquiranm/gno)

Then

🟢 Requirement satisfied
└── 🟢 Maintainer can modify this pull request

Pending initial approval by a review team member, or review from tech-staff

If

🟢 Condition met
└── 🟢 And
    ├── 🟢 The base branch matches this pattern: ^master$
    └── 🟢 Not (🔴 Pull request author is a member of the team: tech-staff)

Then

🟢 Requirement satisfied
└── 🟢 If
    ├── 🟢 Condition
    │   └── 🟢 Or
    │       ├── 🟢 User davd-gzl already reviewed PR 5822 with state APPROVED
    │       ├── 🔴 At least 1 user(s) of the team tech-staff reviewed pull request
    │       └── 🔴 This pull request is a draft
    └── 🟢 Then
        └── 🟢 Not (🔴 This label is applied to pull request: review/triage-pending)

Manual Checks
**IGNORE** the bot requirements for this PR (force green CI check)

If

🟢 Condition met
└── 🟢 On every pull request

Can be checked by

  • Any user with comment edit permission

pd := lastDecl(ns)
valueDecl, ok := pd.(*ValueDecl)
if !ok || !valueDecl.Const {
panic("cannot use iota outside constant declaration")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not directly related. Declaring a variable name iota := 0 is legal in Go (https://go.dev/play/p/FP9F1VlxwAt), and is now returning "cannot use iota outside constant declaration".

Either we should copy Go behavior, or set builtin identifiers cannot be shadowed: iota. like it is done for const iota = 5

@Gno2D2 Gno2D2 removed the review/triage-pending PRs opened by external contributors that are waiting for the 1st review label Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📦 🤖 gnovm Issues or PRs gnovm related

Projects

Development

Successfully merging this pull request may close these issues.

Gno's is too permissive on typecheckon fixedbugs/bug186.go

3 participants