Skip to content

fix(gnovm): enforce int type for untyped variadic arguments in make#5249

Merged
thehowl merged 20 commits intognolang:masterfrom
ltzmaxwell:fix/maxwell/enforce_varg_type
Apr 1, 2026
Merged

fix(gnovm): enforce int type for untyped variadic arguments in make#5249
thehowl merged 20 commits intognolang:masterfrom
ltzmaxwell:fix/maxwell/enforce_varg_type

Conversation

@ltzmaxwell
Copy link
Copy Markdown
Contributor

@ltzmaxwell ltzmaxwell commented Mar 6, 2026

No description provided.

@Gno2D2
Copy link
Copy Markdown
Collaborator

Gno2D2 commented Mar 6, 2026

🛠 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)

☑️ 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: ltzmaxwell/gno)

Then

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

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

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 6, 2026

Codecov Report

❌ Patch coverage is 80.30303% with 13 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
gnovm/pkg/gnolang/preprocess.go 81.66% 9 Missing and 2 partials ⚠️
gnovm/pkg/gnolang/type_check.go 66.66% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@ltzmaxwell ltzmaxwell changed the title fix(gnovm): specify correct type for make varg fix(gnovm): enforce int type for untyped variadic arguments in make Mar 6, 2026
@ltzmaxwell ltzmaxwell requested a review from thehowl March 11, 2026 11:40
Copy link
Copy Markdown
Member

@thehowl thehowl left a comment

Choose a reason for hiding this comment

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

also a proposal, why don't we make the arg in uverse Vrd(IntT())?

@Kouteki Kouteki moved this from Triage to In Review in 🧙‍♂️Gno.land development Mar 20, 2026
@Kouteki Kouteki added this to the 🐛Beta Bug Bash milestone Mar 20, 2026
@ltzmaxwell
Copy link
Copy Markdown
Contributor Author

ltzmaxwell commented Mar 30, 2026

also a proposal, why don't we make the arg in uverse Vrd(IntT())?

Vrd(IntT()) is too restrictive because it forces the variadic argument type in make's len/cap parameters to be exactly
int, whereas it should accept any integer type (such as uint, int32, etc.).

we can introduce a new constraint type to make it like Vrd(anyIntergerT()), but thus need some special handling in checkOrConvertType, it looks not worthy plus the overhead that the new constraint type definition introduced.

However, inspired by this, a check for typed arguments is added, as demonstrated in varg_3.gno.

ltzmaxwell and others added 6 commits March 30, 2026 21:28
…ake flag

Move the int-type enforcement for make's variadic size arguments directly
into the `case "make":` special-case block, eliminating the need for the
`isBuiltinMake` boolean that coupled the ENTER and LEAVE phases.
refactor(gnovm): inline make varg type enforcement, remove isBuiltinMake flag
@thehowl thehowl merged commit 2d7f193 into gnolang:master Apr 1, 2026
111 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in 💪 Bounties & Worx Apr 1, 2026
moul pushed a commit that referenced this pull request Apr 1, 2026
…5249)

Co-authored-by: Morgan Bazalgette <morgan@morganbaz.com>
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

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants