summary refs log tree commit diff stats
path: root/tests/closure/tdeeplynested.nim
blob: ddf4fa6a49d6b9300b6a1e1e56c589f3d891f122 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
discard """
  output: '''int: 108'''
"""

# bug #4070

proc id(f: (proc())): auto =
  return f

proc foo(myinteger: int): (iterator(): int) =
  return iterator(): int {.closure.} =
           proc bar() =
             proc kk() =
               echo "int: ", myinteger

             kk()

           id(bar)()

discard foo(108)()