summary refs log tree commit diff stats
path: root/tests/method/trecmeth.nim
blob: ac0a1e977c16b70c91f0f477596dab25ad588841 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Note: We only compile this to verify that code generation
# for recursive methods works, no code is being executed

type
  Obj = ref object of RootObj

# Mutual recursion

method alpha(x: Obj) {.base.}
method beta(x: Obj) {.base.}

method alpha(x: Obj) =
  beta(x)

method beta(x: Obj) =
  alpha(x)

# Simple recursion

method gamma(x: Obj) {.base.} =
  gamma(x)