Add redefine pragma to inner template (#220)

This commit is contained in:
andri lim 2024-06-18 23:00:47 +07:00 committed by GitHub
parent ad8721e0f3
commit f40a8ba5c8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -120,7 +120,10 @@ template unpackPositional(params: RequestParamsRx,
paramType: type) =
## Convert a positional parameter from Json into Nim
template innerNode() =
when not defined(nimHasTemplateRedefinitionPragma):
{.pragma: redefine.}
template innerNode() {.redefine.} =
paramVar = unpackArg(params.val(pos), paramName, paramType)
# e.g. (A: int, B: Option[int], C: string, D: Option[int], E: Option[string])