summary refs log tree commit diff stats
path: root/tests/concepts/tseqofconcept.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/concepts/tseqofconcept.nim')
-rw-r--r--tests/concepts/tseqofconcept.nim19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/concepts/tseqofconcept.nim b/tests/concepts/tseqofconcept.nim
new file mode 100644
index 000000000..5e44117ea
--- /dev/null
+++ b/tests/concepts/tseqofconcept.nim
@@ -0,0 +1,19 @@
+discard """
+output: "1\n2\n3"
+"""
+
+type
+  MyConcept = concept x
+    someProc(x)
+
+  SomeSeq = seq[MyConcept]
+
+proc someProc(x:int) = echo x
+
+proc work (s: SomeSeq) =
+  for item in s:
+    someProc item
+
+var s = @[1, 2, 3]
+work s
+