summary refs log tree commit diff stats
path: root/tests/reject/tillrec.nim
blob: 3f8fe60fca2ba979d7e90864d64e8e1bc86a6da2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
discard """
  file: "tillrec.nim"
  line: 13
  errormsg: "illegal recursion in type \'TIllegal\'"
"""
# test illegal recursive types

type
  TLegal {.final.} = object
    x: int
    kids: seq[TLegal]

  TIllegal {.final.} = object  #ERROR_MSG illegal recursion in type 'TIllegal'
    y: Int
    x: array[0..3, TIllegal]