summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2023-01-18 18:52:18 +0800
committerGitHub <noreply@github.com>2023-01-18 11:52:18 +0100
commitfc35f83eee55610af3931f95771b6d1bce1fc845 (patch)
treeff4314e15cfb5405160c45a0afa67b9033de0be2 /tests
parentc4035d7f7c424caa81ee449d2032ecd8e8967ebd (diff)
downloadNim-fc35f83eee55610af3931f95771b6d1bce1fc845.tar.gz
fixes #21260; add check for illegal recursion for defaults (#21270)
* fixes #21260; add check for illegal recursion for defaults

* fixes differently
Diffstat (limited to 'tests')
-rw-r--r--tests/types/t21260.nim13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/types/t21260.nim b/tests/types/t21260.nim
new file mode 100644
index 000000000..90d6613c1
--- /dev/null
+++ b/tests/types/t21260.nim
@@ -0,0 +1,13 @@
+discard """
+  errormsg: "illegal recursion in type 'Foo'"
+  line: 8
+"""
+
+type
+  Kind = enum kA, kB
+  Foo = object
+    case k: Kind:
+    of kA:
+      foo: Foo
+    of kB:
+      discard