> I have to provide an initElement proc in the generic module in order to
> compile foo[T] (line #10). That's the reason there's a forward declaration of
> initElement (line #7).
I tried your code, removed the forward-declaration and fixed your initElement
definition and it's working fine.
proc initElement[T: TypeInstance]: T =
result.c = 'E'
discard foo[TypeInstance]()
Run
I tried with `compile` proc and tried to call with `discard foo[int]()` and the
compiler throw out error with error message supplied to error pragma.
Try it.