tclosureeq.nim 263 B

1234567891011121314151617181920
  1. discard """
  2. output: '''true
  3. true'''
  4. """
  5. # bug #4186
  6. type
  7. Predicate[T] = proc(item: T): bool
  8. proc a[T](): Predicate[T] =
  9. return nil
  10. proc b[T](): Predicate[T] =
  11. return a[T]()
  12. echo b[int]() == nil # ok
  13. let x = b[int]()
  14. echo x == nil #won't compile