fixes #18983 #5282 #13008; recursive types casue infinite type (#20172)

* fixes #18983 #5282 #13008; recursive types casue infinite type

* re

* add testcases

(cherry picked from commit a895bbf714)
This commit is contained in:
ringabout
2022-08-24 01:58:50 +08:00
committed by narimiran
parent b92336ab33
commit 7acdacb253
3 changed files with 39 additions and 2 deletions

7
tests/errmsgs/t18983.nim Normal file
View File

@@ -0,0 +1,7 @@
discard """
errormsg: "illegal recursion in type 'A'"
"""
type
A* = A
B = (A,)

5
tests/errmsgs/t5282.nim Normal file
View File

@@ -0,0 +1,5 @@
discard """
errormsg: "illegal recursion in type 'x'"
"""
type x = distinct x