Skip to content

fixes #23564; hasCustomPragma skips alises types #24994

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

Merged
merged 6 commits into from
Jun 27, 2025
Merged

fixes #23564; hasCustomPragma skips alises types #24994

merged 6 commits into from
Jun 27, 2025

Conversation

ringabout
Copy link
Member

@ringabout ringabout commented Jun 12, 2025

fixes #23564

perhaps handle generic aliases (tyGenericInst for aliases types) if needed

; hasCustomPragma skips alises types
@ringabout ringabout marked this pull request as draft June 12, 2025 13:48
@ringabout
Copy link
Member Author

ringabout commented Jun 12, 2025

It seems that we need to add an internal version of getTypeInst to skip aliases types

@metagn
Copy link
Collaborator

metagn commented Jun 12, 2025

I would think it should be exposed to users as well. The first way I thought of doing it was to go in the impl for the type alias sym and recurse with the body as the type instead, but the body (Sym "T0") just has the alias type (T) as its sym which gets used by getTypeInst and causes a loop. Maybe skipAlias or something more general can be exposed instead. (might be fine to specialize since getType never represents a tyAlias).

@ringabout
Copy link
Member Author

ringabout commented Jun 13, 2025

Okay, I will add something like getTypeInstSkipAlias to skip aliases

@ringabout ringabout marked this pull request as ready for review June 13, 2025 14:47
@Araq Araq merged commit 7e6fa9e into devel Jun 27, 2025
28 of 29 checks passed
@Araq Araq deleted the pr_skip_aliases branch June 27, 2025 08:18
Copy link
Contributor

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

Hint: mm: orc; opt: speed; options: -d:release
182762 lines; 8.393s; 659.68MiB peakmem

narimiran pushed a commit that referenced this pull request Jun 27, 2025
fixes #23564

perhaps handle generic aliases (tyGenericInst for aliases types) if
needed

(cherry picked from commit 7e6fa9e)
narimiran pushed a commit that referenced this pull request Jun 27, 2025
fixes #23564

perhaps handle generic aliases (tyGenericInst for aliases types) if
needed

(cherry picked from commit 7e6fa9e)
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.

hasCustomPragma stops working after typedesc is copied
3 participants