-
-
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
static[T] argument is not substituted properly in .emit pragma #4165
Comments
Well we could produce an error, but it's not supported. static parameters disappear at runtime. |
Would it be possible to emit a reference to the produced global variable in such case? Error is fine for me, there is a simple workaround: {.emit:"""/*INCLUDESECTION*/
#include <stdio.h>
""".}
proc printStr(s: static[string]) =
let sCopy = s
{.emit: "puts(`sCopy`->data);" .}
printStr("hello static") Although would be nice to get rid of |
This issue has been automatically marked as stale because it has not had recent activity. If you think it is still a valid issue, write a comment below; otherwise it will be closed. Thank you for your contributions. |
Sample:
The text was updated successfully, but these errors were encountered: