There are multiple ways to do this in the compiler and you need to play around 
to see what works best for sizeof and alignof and offsetof.

  * Add new `mAlignOf`, `mOffsetOf` to the `ast.TMagic` enum.



Either add the handling to:

1\. `magicsAfterOverloadResolution` in `semmagic.nim`

Or:

2\. `semMagic` in `semexprs.nim` and as the comment says don't forget to read 
the comment:

> # DON'T forget to update ast.SpecialSemMagics if you add a magic here!

With (2) you can bypass the overloading resolution mechanism which introduces a 
builtin that cannot be overloaded (only shadowed) so (1) is the preferred way. 

Reply via email to