summary refs log tree commit diff stats
path: root/tests/ccgbugs/tclosureeq.nim
blob: 0486a9559125a7624299967b207c8d501bdfbae4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
discard """
  output: '''true
true'''
"""

# bug #4186
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  # ok

let x = b[int]()
echo x == nil     #won't compile