summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2024-04-03 00:09:10 +0800
committerGitHub <noreply@github.com>2024-04-02 18:09:10 +0200
commit32fa7e2871f7e23a0b7ca056e8bb7f7f0e6cc6d1 (patch)
treef93dfd7e1e022402c9914b1057128b0c8fa2ee5b /tests
parentcf00b2fd9e00909ac6368ece9515f0e020d7813d (diff)
downloadNim-32fa7e2871f7e23a0b7ca056e8bb7f7f0e6cc6d1.tar.gz
fixes #9550; Concept related crash only when compiling to JS (#23470)
fixes #9550
Diffstat (limited to 'tests')
-rw-r--r--tests/concepts/tusertypeclasses2.nim11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/concepts/tusertypeclasses2.nim b/tests/concepts/tusertypeclasses2.nim
index c9978f6ef..2d4688265 100644
--- a/tests/concepts/tusertypeclasses2.nim
+++ b/tests/concepts/tusertypeclasses2.nim
@@ -1,3 +1,7 @@
+discard """
+  target: "c js"
+"""
+
 block:
   type
     hasFieldX = concept z
@@ -42,3 +46,10 @@ block:
   foo2(x)
   foo3(x)
   foo4(x)
+
+block: # bug #9550
+  type Foo = concept c
+    for v in c: (v is char)
+
+  func foo(c: Foo) = (for v in c: discard)
+  foo @['a', 'b' ,'c']