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")