From bce2d57d95b71f3e4a5d4585ea735870251d1caa Mon Sep 17 00:00:00 2001 From: Reimer Behrends Date: Sun, 2 Nov 2014 15:37:16 +0100 Subject: [PATCH] Added test case for recursive methods. --- tests/method/trecmeth.nim | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 tests/method/trecmeth.nim diff --git a/tests/method/trecmeth.nim b/tests/method/trecmeth.nim new file mode 100644 index 0000000000..32f620f15f --- /dev/null +++ b/tests/method/trecmeth.nim @@ -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) +