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): handle type alias declaration for PrimitiveType #3222

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

hthieu1110
Copy link
Contributor

@hthieu1110 hthieu1110 commented Nov 27, 2024

Fixes: #3203

Contributors' checklist...
  • 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

@github-actions github-actions bot added the 📦 🤖 gnovm Issues or PRs gnovm related label Nov 27, 2024
Copy link

codecov bot commented Nov 27, 2024

@hthieu1110 hthieu1110 marked this pull request as ready for review November 28, 2024 13:59
@Kouteki Kouteki added the in focus Core team is prioritizing this work label Nov 28, 2024
@Kouteki Kouteki added this to the ⏭️Next after mainnet milestone Nov 28, 2024
@jefft0 jefft0 added the review/triage-pending PRs opened by external contributors that are waiting for the 1st review label Nov 28, 2024
Copy link
Contributor

@mvertes mvertes left a comment

Choose a reason for hiding this comment

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

Looks good to me

@thehowl thehowl removed the review/triage-pending PRs opened by external contributors that are waiting for the 1st review label Nov 28, 2024
@gh-gno-bot
Copy link

gh-gno-bot commented Nov 28, 2024

Merge Requirements

The following requirements must be fulfilled before a pull request can be merged.
Some requirement checks are automated and can be verified by the CI, while others need manual verification by a staff member.

These requirements are defined in this configuration file.

Automated Checks

🟢 Maintainers must be able to edit this pull request
🟢 The pull request head branch must be up-to-date with its base

Details
Maintainers must be able to edit this pull request

If

🟢 Condition met
└── 🟢 On every pull request

Then

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

The pull request head branch must be up-to-date with its base

If

🟢 Condition met
└── 🟢 On every pull request

Then

🟢 Requirement satisfied
└── 🟢 Head branch (hthieu1110:fix/mishandling-of-type-declaration-3203) is up to date with base (master): behind by 0 / ahead by 7

Manual Checks

  • The pull request description provides enough details
Details
The pull request description provides enough details

If

🟢 Condition met
└── 🟢 Not (🔴 Pull request author is a member of the team: core-contributors)

Can be checked by

  • team core-contributors

@@ -2352,6 +2352,8 @@ func preprocess1(store Store, ctx BlockNode, n Node) Node {
// }
*dst = *dt2
}
case PrimitiveType:
Copy link
Member

@omarsy omarsy Nov 28, 2024

Choose a reason for hiding this comment

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

WDYT, handle other types like PointerType, NativeType ... ?
example this:

package main

type (
	Number  = *int32
	Number2 = Number
)

func f(n Number) { println(n) }

func main() {
	var n int32 = 5
	f(&n)
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it's good idea

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added cases for PointerType. I think all the existing handled cases + PrimitiveCase cover already Native case so it should be fine

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@omarsy just found this: #1361 which confirms that we dont need to process NativeType

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in focus Core team is prioritizing this work 📦 🤖 gnovm Issues or PRs gnovm related
Projects
Status: In Review
Development

Successfully merging this pull request may close these issues.

Mishandling of type redeclaration
8 participants