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

treat generic body type as atomic in iterOverType #24096

Merged
merged 1 commit into from
Sep 11, 2024

Conversation

metagn
Copy link
Collaborator

@metagn metagn commented Sep 11, 2024

follows up #24095

In #24095 a check was added that used iterOverType to check if a type contained unresolved types, with the aim of always treating tyGenericBody as resolved. But the body of the tyGenericBody is also iterated over in iterOverType, so if the body of the type actually used generic parameters (which isn't the case in the test added in #24095, but is now), the check would still count the type as unresolved.

This is handled by not iterating over the children of tyGenericBody, the only users of iterOverType are containsGenericType and containsUnresolvedType, the first one always returns true for tyGenericBody and the second one aims to always return false. Unfortunately this means iterOverType isn't as generic of an API anymore but maybe it shouldn't be used anymore for these procs.

@Araq Araq merged commit 793cee4 into nim-lang:devel Sep 11, 2024
19 checks passed
Copy link
Contributor

Thanks for your hard work on this PR!
The lines below are statistics of the Nim compiler built from 793cee4

Hint: mm: orc; opt: speed; options: -d:release
174293 lines; 8.129s; 654.344MiB peakmem

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.

2 participants