This commit is contained in:
Andreas Rumpf 2016-06-02 17:23:39 +02:00
commit 87ffff96d2
2 changed files with 20 additions and 1 deletions

View file

@ -0,0 +1,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