Nim is a compiled, garbage-collected systems programming language with a design that focuses on efficiency, expressiveness, and elegance (in that order of priority).
When a proc returns Future[something] Nim does not allow you to use argument: auto in the arguments,
this does not make sense at all for JavaScript targets, it makes sense for other backends tho,
would be great if this restriction can be removed when compiling to Javascript.
When a
proc
returnsFuture[something]
Nim does not allow you to useargument: auto
in the arguments, this does not make sense at all for JavaScript targets, it makes sense for other backends tho, would be great if this restriction can be removed when compiling to Javascript.Complains
Error: no generic parameters allowed for Future
.Alternatively the
Error
can be converted toWarning
.https://github.com/nim-lang/Nim/blob/39ad9a69a9473aa88d4457039393f6ed15fafcfa/compiler/semtypes.nim#L40
https://github.com/nim-lang/Nim/blob/39ad9a69a9473aa88d4457039393f6ed15fafcfa/compiler/semtypes.nim#L1459
https://github.com/juancarlospaco/nodejs/runs/2634488564#step:4:215
https://github.com/juancarlospaco/nodejs/blob/5ecccefe2caf9f2e75596c54395031883528f02f/src/nodejs/jstimers.nim#L40-L49
Repro code not too relevant, because by design conceptually the restriction does not make sense for JavaScript whatsoever.