Skip to content
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

Undocumented compilation error using params as param name in rpc method definition #128

Closed
jangko opened this issue Feb 22, 2022 · 0 comments · Fixed by #179
Closed

Undocumented compilation error using params as param name in rpc method definition #128

jangko opened this issue Feb 22, 2022 · 0 comments · Fixed by #179

Comments

@jangko
Copy link
Contributor

jangko commented Feb 22, 2022

The following rpc method definition using params as the param name will trigger compilation error. If renamed to something else it will be ok. looks like the internal templates and macros are messing with it because they use params as their working variable. If we cannot fix it, then doc it at least.

server.rpc("method1") do(params: string) -> bool:
   return true

Error message:

...\engine_api.nim(83, 9) template/generic instantiation of `rpc` from here
...\json_rpc\server.nim(19, 16) template/generic instantiation of `rpc` from here
...\json_rpc\router.nim(155, 73) template/generic instantiation of `async` from here
...\json_rpc\jsonmarshal.nim(244, 22) Error: undeclared field: 'elems' for type system.string [declared in F:\projects\status-nim\lib\system.nim(34, 3)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant