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 name resolution for enums with generics #3307

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

liamnaddell
Copy link
Contributor

@liamnaddell liamnaddell commented Dec 17, 2024

Fixes #3304
Here is a checklist to help you with your PR.

Note that you can skip the above if you are just opening a WIP PR in
order to get feedback.

*Please write a comment explaining your change. This is the message
that will be part of the merge commit.

@liamnaddell liamnaddell changed the title fix resovle enum Fix name resolution for enums with generics Dec 17, 2024
@liamnaddell
Copy link
Contributor Author

Not quite sure if it's appropriate to add a test case for this. It seems like we already have testcases involving enum+Generic, they just weren't run with NR2.0. See, for example issue-850.rs, issue-2105.rs, etc

gcc/rust/ChangeLog:
	* resolve/rust-late-name-resolver-2.0.cc:
	Change the late name resolver to enter proper lexical scope during typechecking
	* resolve/rust-late-name-resolver-2.0.h:
	Add needed prototype to header
	* resolve/rust-toplevel-name-resolver-2.0.cc:
	Add generic parameters to enum's scoped RIB to allow for proper name resolution on types.

Signed-off-by: Liam Naddell <[email protected]>
Copy link
Member

@CohenArthur CohenArthur left a comment

Choose a reason for hiding this comment

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

thanks! this looks great

@CohenArthur
Copy link
Member

Not quite sure if it's appropriate to add a test case for this. It seems like we already have testcases involving enum+Generic, they just weren't run with NR2.0. See, for example issue-850.rs, issue-2105.rs, etc

if these tests are passing now with nr2.0, can we take them out of the exclude list for NR2? or are there other issues with them?

if there are other issues with them I'd like to see a small testcase for this specifically for NR2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generics with Enums does not work with name resolution 2.0
2 participants