Nim icon indicating copy to clipboard operation
Nim copied to clipboard

fixes #23564; `hasCustomPragma` skips alises types

Open ringabout opened this issue 7 months ago • 3 comments

fixes #23564

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

ringabout avatar Jun 12 '25 13:06 ringabout

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

ringabout avatar Jun 12 '25 15:06 ringabout

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).

metagn avatar Jun 12 '25 16:06 metagn

Okay, I will add something like getTypeInstSkipAlias to skip aliases

ringabout avatar Jun 13 '25 09:06 ringabout

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

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

github-actions[bot] avatar Jun 27 '25 08:06 github-actions[bot]