From 117903a6ae01201522af6a2a95aa7c4e0f5fd6a2 Mon Sep 17 00:00:00 2001 From: Araq Date: Wed, 25 Mar 2015 13:02:15 +0100 Subject: [PATCH] fixes #2400 --- compiler/semstmts.nim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index 19514263fb..ae0cbd84f7 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -1151,7 +1151,10 @@ proc semMethod(c: PContext, n: PNode): PNode = result = semProcAux(c, n, skMethod, methodPragmas) var s = result.sons[namePos].sym - if not isGenericRoutine(s) and result.sons[bodyPos].kind != nkEmpty: + if not isGenericRoutine(s): + # why check for the body? bug #2400 has none. Checking for sfForward makes + # no sense either. + # and result.sons[bodyPos].kind != nkEmpty: if hasObjParam(s): methodDef(s, fromCache=false) else: