From 635469ec451d14462285bfe80e68aa1bc786bf0b Mon Sep 17 00:00:00 2001 From: Araq Date: Mon, 6 May 2013 20:36:03 +0200 Subject: [PATCH] fixes #121 --- compiler/semstmts.nim | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index c8fc3e3d3b..713177742d 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -766,6 +766,9 @@ proc SemTypeSection(c: PContext, n: PNode): PNode = proc semParamList(c: PContext, n, genericParams: PNode, s: PSym) = s.typ = semProcTypeNode(c, n, genericParams, nil, s.kind) + if s.kind notin {skMacro, skTemplate}: + if s.typ.sons[0] != nil and s.typ.sons[0].kind == tyStmt: + localError(n.info, errGenerated, "invalid return type: 'stmt'") proc addParams(c: PContext, n: PNode, kind: TSymKind) = for i in countup(1, sonsLen(n)-1):