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

fix(gnovm): in op_binary, return typed booleans where appropriate #3298

Merged
merged 4 commits into from
Dec 11, 2024

Conversation

thehowl
Copy link
Member

@thehowl thehowl commented Dec 8, 2024

bool8.gno was failing, because the result of the == expression is an untyped boolean, while the first value is a typed boolean. This PR ensures that if either of the values in a binary expression is typed, we return a typed bool instead of an untyped bool.

@thehowl thehowl added 🐞 bug Something isn't working 📦 🤖 gnovm Issues or PRs gnovm related labels Dec 8, 2024
@thehowl thehowl added this to the 🚀 Mainnet launch milestone Dec 8, 2024
@thehowl thehowl requested a review from ltzmaxwell December 8, 2024 11:22
@thehowl thehowl self-assigned this Dec 8, 2024
@Gno2D2
Copy link
Collaborator

Gno2D2 commented Dec 8, 2024

🛠 PR Checks Summary

All Automated Checks passed. ✅

Manual Checks (for Reviewers):
  • SKIP: Do not block the CI for this PR
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)
🟢 The pull request head branch must be up-to-date with its base (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
└── 🟢 The pull request was created from a fork (head branch repo: thehowl/gno)

Then

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

The pull request head branch must be up-to-date with its base (more info)

If

🟢 Condition met
└── 🟢 On every pull request

Then

🟢 Requirement satisfied
└── 🟢 Head branch (thehowl:dev/morgan/runtime-typed-bools) is up to date with base (master): behind by 0 / ahead by 4

Manual Checks
**SKIP**: Do not block the CI for this PR

If

🟢 Condition met
└── 🟢 On every pull request

Can be checked by

  • Any user with comment edit permission

Copy link

codecov bot commented Dec 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@Kouteki Kouteki added the in focus Core team is prioritizing this work label Dec 9, 2024
@ltzmaxwell
Copy link
Contributor

I think the root cause for this is in preprocess stage, the untyped T is not correctly converted into the corresponding typed T.

It happens in func convertType, when t is nil or interfaceType, should use defaultTypeOf(t) as the dest t.

@thehowl
Copy link
Member Author

thehowl commented Dec 10, 2024

@ltzmaxwell thanks for the review!

I did some inspection and think I found a more correct fix. Can you take another look?

@thehowl thehowl requested a review from ltzmaxwell December 10, 2024 17:52
@ltzmaxwell
Copy link
Contributor

LGTM.

@ltzmaxwell ltzmaxwell merged commit 7185cef into gnolang:master Dec 11, 2024
105 checks passed
@thehowl thehowl deleted the dev/morgan/runtime-typed-bools branch December 11, 2024 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working in focus Core team is prioritizing this work 📦 🤖 gnovm Issues or PRs gnovm related
Projects
Development

Successfully merging this pull request may close these issues.

4 participants