I am starting to think that this is bug in Nim.

The following works:
    
    
    proc example*(name:string; first: varargs[int]) =
      echo name
      echo first.len
      echo first
    
    example( "hola", 1, 2, 3, 4)
    example( "hola", @[1,2,3,4])
    
    
    Run

I am playing with some bindings to igraph: 
[igraph.nim](https://github.com/mantielero/igraph.nim). In [this 
line](https://github.com/mantielero/igraph.nim/blob/e56804d7cdd57c1abb829ad2e1db20806176e7f2/examples/ex4_6_neighbors.nim#L8)
 I call 
[newSmall](https://github.com/mantielero/igraph.nim/blob/e56804d7cdd57c1abb829ad2e1db20806176e7f2/src/lib/generators.nim#L13-L24).
 In this function, I create a `tmp:seq[cint]` that I try to pass to 
[igraph_small](https://github.com/mantielero/igraph.nim/blob/e56804d7cdd57c1abb829ad2e1db20806176e7f2/src/lib/generators.nim#L22)
 in the last parameter. This is the [igraph_small 
definition](https://github.com/mantielero/igraph.nim/blob/e56804d7cdd57c1abb829ad2e1db20806176e7f2/src/wrapper/igraph_wrapper.nim#L4648-L4650).

I would expect the `varargs` pragma to behave as a normal `varargs`. So, is 
this a bug in Nim or am I doing something wrong?

Reply via email to