summary refs log tree commit diff stats
path: root/tests/concepts/t8558.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/concepts/t8558.nim')
-rw-r--r--tests/concepts/t8558.nim26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/concepts/t8558.nim b/tests/concepts/t8558.nim
new file mode 100644
index 000000000..acb2de30e
--- /dev/null
+++ b/tests/concepts/t8558.nim
@@ -0,0 +1,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)
\ No newline at end of file
39:15 +0100 committer Andreas Rumpf <rumpf_a@web.de> 2017-02-01 23:39:40 +0100 updated appveyor.yml' href='/ahoang/Nim/commit/appveyor.yml?h=devel&id=05fe52383235bc0f0435260ea2296182effdfd1b'>05fe52383 ^
9f6f78ac6 ^
05fe52383 ^
9f6f78ac6 ^
05fe52383 ^
96c571dd9 ^
05fe52383 ^



9f6f78ac6 ^






c525dfabc ^
9f6f78ac6 ^

26568dff0 ^

d2208091f ^



97738a4f2 ^

9f6f78ac6 ^

97738a4f2 ^
f078f272e ^
57f4abf6f ^

9f6f78ac6 ^

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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65