summary refs log tree commit diff stats
path: root/tests/accept/compile/tgenericrefs.nim
blob: 3b7940098e89b07ef31c66ebf7d2427305a5b702 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
discard """
  disabled: true
"""

# Compiles:

type 
  TA[T] = object
  PA[T] = ref TA[T]
var a: PA[string]

# Compiles unless you use var a: PA[string]
type 
  PA = ref TA
  TA[T] = object


# Cannot instantiate:
type 
  TA[T] = object
    a: PA[T]
  PA[T] = ref TA[T]

type 
  PA[T] = ref TA[T]
  TA[T] = object