mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
23 lines
366 B
Nim
23 lines
366 B
Nim
# 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)
|
|
|