From 52a3acb0663a7d94c10f128a8ed3e1ff8e3b4be4 Mon Sep 17 00:00:00 2001 From: Reimer Behrends Date: Fri, 31 Oct 2014 07:55:56 +0100 Subject: [PATCH] Fix method recursion bug. Additional checks for method call transformations. --- compiler/transf.nim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/compiler/transf.nim b/compiler/transf.nim index b9b06675e..20fd5620f 100644 --- a/compiler/transf.nim +++ b/compiler/transf.nim @@ -624,7 +624,11 @@ proc transformCall(c: PTransf, n: PNode): PTransNode = # bugfix: check after 'transformSons' if it's still a method call: # use the dispatcher for the call: if s.sons[0].kind == nkSym and s.sons[0].sym.kind == skMethod: - result = methodCall(s).PTransNode + let t = lastSon(s.sons[0].sym.ast) + if t.kind == nkSym and sfDispatcher in t.sym.flags: + result = methodCall(s).PTransNode + else: + result = s.PTransNode else: result = s.PTransNode