I don't understand why the last line causes a compilation error (particularly considering the code a few lines up works fine). Is there a solution?
type
Predicate[T] = proc(item: T): bool
proc a[T](): Predicate[T] =
return nil
proc b[T](): Predicate[T] =
return a[T]()
echo b[int]() == nil #doesn't crash
let x = b[int]()
echo x == nil #won't compi