summary refs log tree commit diff stats
path: root/tests/run/tclosure3.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2012-07-16 23:00:57 +0200
committerAraq <rumpf_a@web.de>2012-07-16 23:00:57 +0200
commit8d99753d6320489e4de8cf186415b0a7be8260b4 (patch)
tree2008a25dac1df222efc2c205fdf772ba5a533ecc /tests/run/tclosure3.nim
parent56b4e3ad91a0dda632ba6bab7139665a3da163d3 (diff)
downloadNim-8d99753d6320489e4de8cf186415b0a7be8260b4.tar.gz
preparations for making 'closure' the default calling convention for proc types
Diffstat (limited to 'tests/run/tclosure3.nim')
-rw-r--r--tests/run/tclosure3.nim6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/run/tclosure3.nim b/tests/run/tclosure3.nim
index b2748035b..bb217387f 100644
--- a/tests/run/tclosure3.nim
+++ b/tests/run/tclosure3.nim
@@ -6,13 +6,13 @@ discard """
 proc main =
   const n = 30
   for iterations in 0..50_000:
-    var s: seq[proc(): int {.closure.}] = @[]
+    var s: seq[proc(): string {.closure.}] = @[]
     for i in 0 .. n-1:
       let ii = i
-      s.add(proc(): int = return ii*ii)
+      s.add(proc(): string = return $(ii*ii))
     for i in 0 .. n-1:
       let val = s[i]()
-      if val != i*i: echo "bug  ", val
+      if val != $(i*i): echo "bug  ", val
     
     if getOccupiedMem() > 3000_000: quit("still a leak!")
   echo "success"
96af395 ^
f7c9c8f0 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

                                            

                                                                        
 
          

                                                  


                                                         
                                   
     


                 
          


                                                                      
     
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328