fixes #21260; add check for illegal recursion for defaults (#21270)

* fixes #21260; add check for illegal recursion for defaults

* fixes differently
This commit is contained in:
ringabout 2023-01-18 18:52:18 +08:00 • committed by GitHub
commit fc35f83eee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 38 additions and 30 deletions

13
tests/types/t21260.nim Normal file
View file

@ -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