We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
From Discord:
macro mymacro(typ: typedesc; def) = def macro mymacro2(typ: typedesc; typ2: typedesc; def) = def template mytemplate(typ: typedesc) = # works proc myproc() {.mymacro: typ .} = discard template mytemplate2(typ: typedesc) = # Error: undeclared identifier: 'typ' proc myproc2() {.mymacro(typ) .} = discard template mytemplate2(typ: typedesc, typ2: typedesc) = # Error: undeclared identifier: 'typ' proc myproc3() {.mymacro2(typ, typ2) .} = discard template mytemplate4() = # works proc myproc4() {.mymacro2(string, int) .} = discard mytemplate(string) mytemplate2(string) # fails to compile if uncommented mytemplate3(string, int) # fails to compile if uncommented mytemplate4()
all versions
Error: undeclared identifier: 'typ'
compiles
calling the macro explicitly
Culprit is here, only colon expressions are checked:
Nim/compiler/semtempl.nim
Lines 541 to 544 in a275421
The text was updated successfully, but these errors were encountered:
911cef1
Successfully merging a pull request may close this issue.
Description
From Discord:
Nim Version
all versions
Current Output
Expected Output
Known Workarounds
calling the macro explicitly
Additional Information
Culprit is here, only colon expressions are checked:
Nim/compiler/semtempl.nim
Lines 541 to 544 in a275421
The text was updated successfully, but these errors were encountered: