In the code below, the generic parameter hits the `else` clause even if it is
`int`. How to make the parameter be late bound in this use case? Making the
proc a template did not help.
template IntToStr(t: typedesc): auto =
when t is int:
string
else:
That works, thank you
As in the title, do I need to enable some other option or use a particular
version of the compiler for `{.experimental: "inferGenericTypes".}` to work? It
gets rejected for me with `unknown experimental feature`. Thanks!
Thank you. My understanding was that `typed` should be used when the code is
meaningful in itself, like here. Is this behaviour expected?
I'm checking out Nim, have read most of the manual - there are a lot of things
I like! I'm however having problems with nested template / macro / generic
code, which I do not know why it doesn't work:
import iterrr
proc testIterrr() =
let m = @[1, 2, 3].items.iterrr