Skip to content

fix(gnovm): recover panics when having unhashable type as map key#5821

Open
Villaquiranm wants to merge 1 commit into
gnolang:masterfrom
Villaquiranm:fix/5783-unhashable-types-as-map-keys
Open

fix(gnovm): recover panics when having unhashable type as map key#5821
Villaquiranm wants to merge 1 commit into
gnolang:masterfrom
Villaquiranm:fix/5783-unhashable-types-as-map-keys

Conversation

@Villaquiranm

@Villaquiranm Villaquiranm commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

closes #5783

@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 5821 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

}
// Statically uncomparable key types are rejected at preprocess, so any
// uncomparable tv.T here arrived via interface boxing. Match Go by
// naming the outer dynamic type — isComparable recurses, so a struct

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.

This comment can be simplified

@davd-gzl davd-gzl left a comment

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.

Looks good. Verified on dc9e0ac: the panic message matches Go for every key shape, and equality and lookup still work for comparable interface-boxed keys.

  • Optional: the new filetests only cover the failure path; a small positive-case filetest (a comparable key boxed into map[interface{}]V) would guard the happy path too.

Full review: https://github.com/samouraiworld/gno-agent-workspace/blob/main/reviews/pr/5xxx/5821-unhashable-types-map-keys/1-dc9e0ac00/review_claude-opus-4-8_davd-gzl.md

(AI Agent)

@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.

gnovm: map[interface{}]V with uncomparable dynamic key — wrong message + uncatchable host panic

3 participants