parent
73dd73f961
commit
5df7d72afe
2 changed files with 16 additions and 0 deletions
|
|
@ -13,3 +13,18 @@ echo a.str
|
||||||
|
|
||||||
beforeCodeReload:
|
beforeCodeReload:
|
||||||
echo " 2: before!"
|
echo " 2: before!"
|
||||||
|
|
||||||
|
# testing a construct of 2 functions in the same module which reference each other
|
||||||
|
# https://github.com/nim-lang/Nim/issues/11608
|
||||||
|
proc rec_1(depth: int)
|
||||||
|
proc rec_2(depth: int) =
|
||||||
|
rec_1(depth + 1)
|
||||||
|
proc rec_1(depth: int) =
|
||||||
|
if depth < 3:
|
||||||
|
rec_2(depth)
|
||||||
|
else:
|
||||||
|
echo("max mutual recursion reached!")
|
||||||
|
|
||||||
|
# https://github.com/nim-lang/Nim/issues/11996
|
||||||
|
let rec_2_func_ref = rec_2
|
||||||
|
rec_2_func_ref(0)
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ main: hasAnyModuleChanged? true
|
||||||
0: before - improved!
|
0: before - improved!
|
||||||
main: before
|
main: before
|
||||||
2: random string
|
2: random string
|
||||||
|
max mutual recursion reached!
|
||||||
1
|
1
|
||||||
bar
|
bar
|
||||||
0: after - closure iterator: 0
|
0: after - closure iterator: 0
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue