From 2475794a75cb0455ba9cdf7af427047fb9cde61e Mon Sep 17 00:00:00 2001 From: Araq Date: Thu, 2 Oct 2014 11:10:43 +0200 Subject: [PATCH] fixes a minor bug when 'type' is used in a wrong way --- compiler/renderer.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/renderer.nim b/compiler/renderer.nim index 29f581573..a4469acda 100644 --- a/compiler/renderer.nim +++ b/compiler/renderer.nim @@ -1009,9 +1009,9 @@ proc gsub(g: var TSrcGen, n: PNode, c: TContext) = put(g, tkElse, " else") putWithSpace(g, tkColon, ":") gsub(g, n.sons[0]) - of nkTypeOfExpr: + of nkTypeOfExpr: putWithSpace(g, tkType, "type") - gsub(g, n.sons[0]) + if n.len > 0: gsub(g, n.sons[0]) of nkRefTy: if sonsLen(n) > 0: putWithSpace(g, tkRef, "ref")