Added test case for recursive methods.
This commit is contained in:
parent
1fc8bab643
commit
bce2d57d95
1 changed files with 22 additions and 0 deletions
22
tests/method/trecmeth.nim
Normal file
22
tests/method/trecmeth.nim
Normal file
|
|
@ -0,0 +1,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 TObject
|
||||||
|
|
||||||
|
# Mutual recursion
|
||||||
|
|
||||||
|
method alpha(x: Obj)
|
||||||
|
method beta(x: Obj)
|
||||||
|
|
||||||
|
method alpha(x: Obj) =
|
||||||
|
beta(x)
|
||||||
|
|
||||||
|
method beta(x: Obj) =
|
||||||
|
alpha(x)
|
||||||
|
|
||||||
|
# Simple recursion
|
||||||
|
|
||||||
|
method gamma(x: Obj) =
|
||||||
|
gamma(x)
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue