summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--tests/statictypes/tstatictypes.nim25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/statictypes/tstatictypes.nim b/tests/statictypes/tstatictypes.nim
index ac84c4a31..24c99b26b 100644
--- a/tests/statictypes/tstatictypes.nim
+++ b/tests/statictypes/tstatictypes.nim
@@ -411,3 +411,28 @@ block: # Ensure static descriminated objects compile
   discard instance
   discard MyObject[KindC]()
 
+block: # bug #22600
+  proc f(n: static int): int = n * 2 # same for template
+
+  type
+    a[N: static int] = object
+      field : array[N, uint8]
+
+    b[N: static int] = object
+      field : a[N]
+
+    c[N: static int] = object
+      f0    : a[N     ]         # works
+      f1    : a[N + 1 ]         # asserts
+      f2    : a[f(N)  ]         # asserts
+
+      f3    : b[N     ]         # works
+      f4    : b[N + 1 ]         # asserts
+      f5    : b[f(N)  ]         # asserts
+
+  proc init[N: static int](x : var a[N]) = discard
+  proc init[N: static int](x : var b[N]) = discard
+  proc init[N: static int](x : var c[N]) = x.f1.init() # this is needed
+
+  var x: c[2]
+  x.init()
committer Kartik K. Agaram <vc@akkartik.com> 2015-06-21 23:27:54 -0700 1616 - merging keyboard and events into 'console'' href='/akkartik/mu/commit/074keyboard.mu?h=hlt&id=45c08fea47de1a23ce98f4fc7a1c5c3bed92b5fb'>45c08fea ^
9f484946 ^
7a84094a ^


45c08fea ^

6fef33fd ^
7a84094a ^

6fef33fd ^

45c08fea ^
7a84094a ^
a0331a9b ^
e3092e7b ^

a0331a9b ^
77d5b5d6 ^
4a48bedc ^
760f683f ^
0d2686c7 ^
e3092e7b ^

d803b687 ^
77d5b5d6 ^
4a48bedc ^
e3092e7b ^
104854ca ^
7a84094a ^
a0331a9b ^
e3092e7b ^
7a84094a ^
80df524b ^
502d2ea5 ^
760f683f ^
dd660682 ^
e3092e7b ^
0d2686c7 ^


dd660682 ^
e3092e7b ^
6aa42628 ^
80df524b ^
dd660682 ^
e3092e7b ^

c6c19a27 ^


d803b687 ^
77d5b5d6 ^
4a48bedc ^
d803b687 ^


80df524b ^
dd660682 ^

e3092e7b ^
f8c0ef3e ^
760f683f ^
77d5b5d6 ^
4a48bedc ^
f8c0ef3e ^
d803b687 ^
502d2ea5 ^


136412d2 ^
502d2ea5 ^
f8c0ef3e ^

5b1219ca ^
f8c0ef3e ^
6a0f71b9 ^
760f683f ^
77d5b5d6 ^
4a48bedc ^
6a0f71b9 ^
d803b687 ^
ccfee303 ^


6a0f71b9 ^

5e9eff8c ^
760f683f ^
77d5b5d6 ^
4a48bedc ^
dd660682 ^
104854ca ^
5e9eff8c ^
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104