summary refs log tree commit diff stats
path: root/tests/effects
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2020-10-01 11:16:04 +0200
committerGitHub <noreply@github.com>2020-10-01 11:16:04 +0200
commit2b91845f1db165541be5d2ebad7fe1f956e90fb1 (patch)
treee5443a66c230fc3e1b6002138f464a6eac99680d /tests/effects
parentb703f02ad2a95975513f07d1a48c368b80825ddb (diff)
downloadNim-2b91845f1db165541be5d2ebad7fe1f956e90fb1.tar.gz
refactoring, fixes yet another strictFuncs regression (#15446)
Diffstat (limited to 'tests/effects')
-rw-r--r--tests/effects/tstrict_funcs.nim17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/effects/tstrict_funcs.nim b/tests/effects/tstrict_funcs.nim
new file mode 100644
index 000000000..a45e5f759
--- /dev/null
+++ b/tests/effects/tstrict_funcs.nim
@@ -0,0 +1,17 @@
+discard """
+  cmd: "nim c --experimental:strictFuncs $file"
+"""
+
+import tables, streams, nre, parsecsv
+
+type
+  Contig2Reads = TableRef[string, seq[string]]
+
+proc get_Contig2Reads(sin: Stream, fn: string, contig2len: TableRef[string, int]): Contig2Reads =
+  result = newTable[string, seq[string]]()
+  var parser: CsvParser
+  open(parser, sin, filename = fn, separator = ' ', skipInitialSpace = true)
+  while readRow(parser, 2):
+    if contig2len.haskey(parser.row[1]):
+      mgetOrPut(result, parser.row[1], @[]).add(parser.row[0])
+