Skip to content

Commit

Permalink
Add redefine pragma to inner template (#220)
Browse files Browse the repository at this point in the history
  • Loading branch information
jangko authored Jun 18, 2024
1 parent ad8721e commit f40a8ba
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion json_rpc/private/server_handler_wrapper.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down

0 comments on commit f40a8ba

Please sign in to comment.