summary refs log tree commit diff stats
path: root/tests/effects/tstrict_funcs.nim
blob: d30326123ea0606a24f980a6bf125937b7c370e3 (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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
discard """
  cmd: "nim c --experimental:strictFuncs --experimental:views $file"
"""

import tables, streams, parsecsv
# We import the below modules to check that they compile with `strictFuncs`.
# They are otherwise unused in this file.
import
  complex,
  httpcore,
  math,
  nre,
  rationals,
  sequtils,
  strutils,
  uri

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])



block:
  # issue #15756
  func `&&&`[T](x: var seq[T], y: sink T): seq[T] =
    newSeq(result, x.len + 1)
    for i in 0..x.len-1:
      result[i] = move(x[i])
    result[x.len] = move(y)

  var x = @[0, 1]
  let z = x &&& 2