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

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

* re

* add testcases
This commit is contained in:
ringabout 2022-08-24 01:58:50 +08:00 • committed by GitHub
commit a895bbf714
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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