-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
cannot add custom pragma to templates #18212
Comments
I can confirm this on Nim devel too. From https://nim-lang.org/docs/manual.html#userminusdefined-pragmas-custom-annotations:
But running below: template myCustomPragma {.pragma.}
template myTmplt() {.myCustomPragma.} =
discard gives:
|
please check if duplicate of #15920, is so, close it |
related to timotheecour#129 |
It isn't. template/macro pragma not working inside templates is different than not being able to attach a custom pragma to templates. |
@Clyybber, it is the same as
|
that's not in nim repo though, it's my own issue tracker, so wouldn't count as duplicate |
fix nim-lang#15920, close nim-lang#18212, close nim-lang#14781, close nim-lang#6696, close nim-lang/RFCs#220 Variable macro pragmas have been changed to only take a unary section node. They can now also be applied in sections with multiple variables, as well as `const` sections. They also accept arguments. Templates now support macro pragmas, mirroring other routine types. Type and variable macro pragmas have been made experimental. Symbols without parentheses instatiating nullary macros or templates has also been documented in the experimental manual. A check for a redefinition error based on the left hand side of variable definitions when using variable macro pragmas was disabled. This nerfs `byaddr` specifically, however this has been documented as a consequence of the experimental features `byaddr` uses. Given how simple these changes are I'm worried if I'm missing something.
* New/better macro pragmas, make some experimental fix #15920, close #18212, close #14781, close #6696, close nim-lang/RFCs#220 Variable macro pragmas have been changed to only take a unary section node. They can now also be applied in sections with multiple variables, as well as `const` sections. They also accept arguments. Templates now support macro pragmas, mirroring other routine types. Type and variable macro pragmas have been made experimental. Symbols without parentheses instatiating nullary macros or templates has also been documented in the experimental manual. A check for a redefinition error based on the left hand side of variable definitions when using variable macro pragmas was disabled. This nerfs `byaddr` specifically, however this has been documented as a consequence of the experimental features `byaddr` uses. Given how simple these changes are I'm worried if I'm missing something. * accomodate compiler boot * allow weird pragmas * add test for #10994 * remove some control flow, try remove some logic
* New/better macro pragmas, make some experimental fix nim-lang#15920, close nim-lang#18212, close nim-lang#14781, close nim-lang#6696, close nim-lang/RFCs#220 Variable macro pragmas have been changed to only take a unary section node. They can now also be applied in sections with multiple variables, as well as `const` sections. They also accept arguments. Templates now support macro pragmas, mirroring other routine types. Type and variable macro pragmas have been made experimental. Symbols without parentheses instatiating nullary macros or templates has also been documented in the experimental manual. A check for a redefinition error based on the left hand side of variable definitions when using variable macro pragmas was disabled. This nerfs `byaddr` specifically, however this has been documented as a consequence of the experimental features `byaddr` uses. Given how simple these changes are I'm worried if I'm missing something. * accomodate compiler boot * allow weird pragmas * add test for nim-lang#10994 * remove some control flow, try remove some logic
…elist (nim-lang#21653) * test not restricting custom pragma applied symbols fixes nim-lang#21652 * fix other test * different patch * fix tests * actually test nim-lang#18212 and other routines
…elist (nim-lang#21653) * test not restricting custom pragma applied symbols fixes nim-lang#21652 * fix other test * different patch * fix tests * actually test nim-lang#18212 and other routines
…elist (nim-lang#21653) * test not restricting custom pragma applied symbols fixes nim-lang#21652 * fix other test * different patch * fix tests * actually test nim-lang#18212 and other routines
Example
Current Output
Expected Output
compiles successfully
Additional Information
The text was updated successfully, but these errors were encountered: