> /usercode/in.nim(25, 15) Error: type mismatch: got <seq[Task], cmp: void>

>From this message is quite clear that your template didn't return the untyped 
>as unchecked proc.

>From your template definition, you just defined a proc that only available 
>within that template scope and you didn't return anything. Simply add a line 
>would imply you're returning something
    
    
    template cmpTaskField*(fieldName: untyped): untyped =
      proc cmpT(task1, task2: Task): int = cmp(task1.fieldName, task2.fieldName)
      cmpT
    
    
    Run

Reply via email to