summary refs log tree commit diff stats
path: root/tests/effects/tstrict_funcs.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/effects/tstrict_funcs.nim')
-rw-r--r--tests/effects/tstrict_funcs.nim28
1 files changed, 17 insertions, 11 deletions
diff --git a/tests/effects/tstrict_funcs.nim b/tests/effects/tstrict_funcs.nim
index d30326123..9d20f5d7e 100644
--- a/tests/effects/tstrict_funcs.nim
+++ b/tests/effects/tstrict_funcs.nim
@@ -3,17 +3,6 @@ discard """
 """
 
 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]]
@@ -38,3 +27,20 @@ block:
 
   var x = @[0, 1]
   let z = x &&& 2
+
+
+func copy[T](x: var openArray[T]; y: openArray[T]) =
+  for i in 0..high(x):
+    x[i] = y[i]
+
+type
+  R = ref object
+    a, b: R
+    data: string
+
+proc main =
+  var a, b: array[3, R]
+  b = [R(data: "a"), R(data: "b"), R(data: "c")]
+  copy a, b
+
+main()