link: https://nim-lang.org/docs/manual.html
search for
proc returnZero(): int =
# implicitly returns 0
I get error message:
Error: invalid indentation
1.4.6/config/nim.cfg' [Conf]
I do not think that example is supposed to be runnable, but if you must you can make a PR and replace that code with.
proc returnZero(): int =
## implicitly returns 0
or
proc returnZero(): int = discard
# implicitly returns 0
You example is still not compiling:
proc returnZero(): int = discard
# implicitly returns 0
# but it actually doesn't, because the comment above doesn't match the function signature
var
n : int = returnZero
The original code created this error
.../discard.nim(6, 13) Error: type mismatch: got 'proc (): int' for 'returnZero' but expected 'int'
and now we have that error
.../discard.nim(6, 13) Error: type mismatch: got 'proc (): int{.noSideEffect, gcsafe, locks: 0.}' for 'returnZero' but expected 'int'
(with nim 1.5.1)
Helps if you actually call the procedure and do not attempt to assign it to an int.
proc returnZero(): int = discard
# implicitly returns 0
var n: int = returnZero()