Given the following three small source files below, why does the call c.dump() generate an error (attempting to call undeclared routine: 'dump'), but is it ok if I change this to dump(c)?
alpha.nim:
import bravo
bravo()
bravo.nim:
import charlie
template bravo_aux() =
var c = Charlie()
c.dump()
template bravo*() =
bravo_aux()
charlie.nim:
import charlie
template bravo_aux() =
var c = Charlie()
c.dump()
template bravo*() =
bravo_aux()
I think you pasted the wrong code for charlie.nim. But anyway, it's a limitation of the method call syntax. See https://nim-lang.github.io/Nim/manual.html#templates-limitations-of-the-method-call-syntax
Indeed, charlie was mispasted, fixed that.
Thanks