compile error wrong number of arguments
Closed this issue · 0 comments
gogolxdong commented
/root/.nimble/pkgs2/web3-0.0.1-b33aff0e838c70b0f96fdcba6aa3a2b7338899f0/web3.nim(14, 14) template/generic instantiation of createRpcSigs
from here
/root/.nimble/pkgs2/json_rpc-0.0.2-45b709a459fd275270ef3eb613241338414a75d5/json_rpc/jsonmarshal.nim(214, 20) Error: wrong number of arguments
Nim Compiler Version 1.9.3 [Linux: amd64]
Compiled at 2023-04-15
Copyright (c) 2006-2023 by Andreas Rumpf
git hash: ea8aafa7c9e28e13c73640256505f75b196231b2
active boot switches: -d:release
It in the quote do
line and have no idea where goes wrong.
proc jsonToNim*(assignIdent, paramType, jsonIdent: NimNode, paramNameStr: string, optional = false): NimNode =
# verify input and load a Nim type from json data
# note: does not create `assignIdent`, so can be used for `result` variables
echo paramType.repr," ", jsonIdent.repr," " ,paramNameStr," "
result = newStmtList()
# unpack each parameter and provide assignments
let unpackNode = quote do:
`unpackArg`(`jsonIdent`, `paramNameStr`, type(`paramType`))
if optional:
result.add(quote do: `assignIdent` = `some`(`unpackNode`))
else:
result.add(quote do: `assignIdent` = `unpackNode`)