summary refs log tree commit diff stats
path: root/tests/concepts/t8558.nim
blob: acb2de30e97897bd5f628d1e3339349feff317cd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
discard """
  output: '''10
9
8
7
6
5
4
3
2
1
go!
'''
"""

type Integral = concept x
  x == 0 is bool
  x - 1 is type(x)

proc countToZero(n: Integral) =
  if n == 0: echo "go!"
  else:
    echo n
    countToZero(n-1)

countToZero(10)