fork(1) download
  1. import algorithm
  2. import future
  3.  
  4.  
  5. proc gen[T](list: seq[T]): seq[T] =
  6. # the [T] for cmp is redundant here, but it illustrates the problem
  7. list.sorted( (a, b) => system.cmp[T](a, b))
  8.  
  9. let A = @[1,2,3,4,5,6]
  10. echo gen(A) # on my machine/nim says: cannot instantiate 'Idx' at line 3177 col 12 in Nim/lib/system.nim
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.nim(10, 9) Info: template/generic instantiation from here
prog.nim(7, 16) Warning: '(a; b): auto' has no type. Typeless parameters are deprecated; only allowed for 'template' [TypelessParam]
prog.nim(10, 9) Info: template/generic instantiation from here
prog.nim(7, 17) Warning: '(a; b): auto' has no type. Typeless parameters are deprecated; only allowed for 'template' [TypelessParam]
prog.nim(10, 9) Info: template/generic instantiation from here
prog.nim(7, 39) Info: template/generic instantiation from here
lib/nim/system.nim(933, 8) Error: ambiguous call; both system.==(x: int, y: int) and system.==(x: int, y: int) match for: (int, int)
stdout
Standard output is empty